var app = (function() { var app = {} app.init = function() { app.bind() app.build() app.ready() app.iscroll_options = { mouseWheel: true, scrollbars: true, click: is_android, } } app.bind = function() { if (is_mobile) { document.addEventListener('touchmove', function(e) { e.preventDefault() }) FastClick.attach(document.body) } } app.build = function(data) { app.nav = new NavView() } app.ready = function() { setTimeout(function(){ $("body").removeClass("loading") }, 20) app.view = null console.log("launched") } return app })() $(".cell, .next").css({ 'height': ($(".top").height() + 'px') }); $('.top').flickity({ cellAlign: 'left', contain: true, pageDots: false, wrapAround: true, arrowShape: { x0: 10, x1: 35, y1: 25, x2: 40, y2: 25, x3: 15 } }).on( 'cellSelect', function(e) { var gallery = $(e.target).data('flickity') $(".slide-no").html(gallery.selectedIndex + 1) }) $(".previous, .next").css({ 'height': ($(".top").height() + 'px') }); $('.index').click(function() { $('body').toggleClass('navopen'); }); $('.item').click( function(){ $('body').removeClass('navopen'); }); var delay = (function() { var timer = 0; return function(callback, ms) { clearTimeout(timer); timer = setTimeout(callback, ms); }; })(); $(window).resize(function() { $(".cell, .next, .previous").css({ 'display': 'none' }); $('body').addClass('resizing'); delay(function() { $(".cell, .next, .previous").css({ 'height': ($(".top").height() + 'px'), 'display': 'inline-block' }); $('.top').flickity('resize'); $('body').removeClass('resizing'); }, 400); }) // app.init()