jQuery(document).ready(function($){ //SUB MENU $('.main-menu ul li').hover(function(){ $('.sub-menu:first, .children:first',this).stop(true,true).slideDown('fast'); }, function(){ $('.sub-menu:first, .children:first',this).stop(true,true).slideUp('fast'); }); //BLOG POSTS var curPage = 1; var pagesNum = $('#max-pages').attr('data'); var container = $('.post-boxes'); container.infinitescroll({ navSelector : '.show-more', nextSelector : '.show-more > a', itemSelector : '.post-boxes .post-box', behavior: 'local', maxPage: pagesNum },function(arrayOfNewElems){ curPage++; container.masonry( 'appended', arrayOfNewElems ); $('.show-more').fadeIn(); if(curPage == pagesNum) { $('.show-more').fadeOut().remove(); } else { $('.show-more').fadeIn(); } }); container.infinitescroll('unbind'); $('.show-more > a').on('click', function(e) { e.preventDefault(); container.infinitescroll('retrieve'); }); container.masonry({ itemSelector: '.post-box', columnWidth: '.post-box' }); // SLIDER $('#home-slider').slick({ centerMode: true, autoplay: true, centerPadding: '130px', slidesToShow: 3, responsive: [ { breakpoint: 768, settings: { arrows: true, centerMode: true, centerPadding: '40px', slidesToShow: 3 } }, { breakpoint: 600, settings: { arrows: true, centerMode: true, slidesToShow: 1, centerPadding: '0' } } ] }); $('#main-menu').mmenu({ extensions : [ 'effect-slide-menu', 'pageshadow' ], navbar : { add : false }, navbars : [ { position : 'top', content : [ 'prev', 'title', 'close' ] } ], }, { clone : true }); $("a[href='#top']").click(function() { $("html, body").animate({ scrollTop: 0 }, "slow"); return false; }); })