;(function () { 'use strict'; // ipad and ipod detection var isipad = function(){ return (navigator.platform.indexof("ipad") != -1); }; var isiphone = function(){ return ( (navigator.platform.indexof("iphone") != -1) || (navigator.platform.indexof("ipod") != -1) ); }; // offcanvass var offcanvass = function() { $('body').on('click', '.js-fh5co-menu-btn, .js-fh5co-offcanvass-close', function(){ $('#fh5co-offcanvass').toggleclass('fh5co-awake'); }); }; // click outside of offcanvass var mobilemenuoutsideclick = function() { $(document).click(function (e) { var container = $("#fh5co-offcanvass, .js-fh5co-menu-btn"); if (!container.is(e.target) && container.has(e.target).length === 0) { if ( $('#fh5co-offcanvass').hasclass('fh5co-awake') ) { $('#fh5co-offcanvass').removeclass('fh5co-awake'); } } }); $(window).scroll(function(){ if ( $(window).scrolltop() > 500 ) { if ( $('#fh5co-offcanvass').hasclass('fh5co-awake') ) { $('#fh5co-offcanvass').removeclass('fh5co-awake'); } } }); }; // magnific popup var magnifpopup = function() { $('.image-popup').magnificpopup({ type: 'image', removaldelay: 300, mainclass: 'mfp-with-zoom', titlesrc: 'title', gallery:{ enabled:true }, zoom: { enabled: true, // by default it's false, so don't forget to enable it duration: 300, // duration of the effect, in milliseconds easing: 'ease-in-out', // css transition easing function // the "opener" function should return the element from which popup will be zoomed in // and to which popup will be scaled down // by defailt it looks for an image tag: opener: function(openerelement) { // openerelement is the element on which popup was initialized, in this case its tag // you don't need to add "opener" option if this code matches your needs, it's defailt one. return openerelement.is('img') ? openerelement : openerelement.find('img'); } } }); }; var animateboxwaypoint = function() { if ($('.animate-box').length > 0) { $('.animate-box').waypoint( function( direction ) { if( direction === 'down' && !$(this).hasclass('animated') ) { $(this.element).addclass('bouncein animated'); } } , { offset: '75%' } ); } }; $(function(){ magnifpopup(); offcanvass(); mobilemenuoutsideclick(); animateboxwaypoint(); }); }());