', '' ] } ] }); var API = $('#nav-mobile').data('mmenu'); var icon = $('#nav-icon--mobile'); $(icon).click(function() { API.open(); }); API.bind( "opened", function() { $(icon).addClass( "open" ); }); API.bind( "closed", function() { $(icon).removeClass( "open" ); this.closeAllPanels(); }); }); /*lazy load images*/ [].forEach.call(document.querySelectorAll('.lazy-load'), function(img) { img.setAttribute('src', img.getAttribute('data-src')); img.onload = function() { img.removeAttribute('data-src'); }; }); /*Subpage carousel effect*/ var loadFrom = window.localStorage.getItem('loadFrom'); var scrollPosition = window.localStorage.getItem('scrollPosition'); window.localStorage.removeItem('loadFrom'); window.localStorage.removeItem('scrollPosition'); if(loadFrom == 'next'){ document.getElementsByTagName('body')[0].className+=' from-next' } if(loadFrom == 'previous'){ document.getElementsByTagName('body')[0].className+=' from-previous' } window.onload = function(){ carouselEffectLoad(loadFrom); }; $(document).ready(function(){ carouselEffectScrollPosition(scrollPosition); });