'); $.get(href, function(response) { if(!sbwis.msieversion()) { document.title = $(response).filter('title').html(); } var html = $(response).find('ul.products').html(); $('ul.products').html(html); var html = $(response).find('.woocommerce-pagination').html(); $('.woocommerce-pagination').html(html); $('.sb-infinite-scroll-loader').remove(); sbwis.onfinish(); var scrollto = 0; if($('html, body').length) { var scrollto = $('html, body').offset().top; } $('html, body').animate({ scrollTop: scrollto }, 500); $('ul.products li.product').addClass('animated fadeIn').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() { $(this).removeClass('animated fadeIn'); }); }); } }); } if(pagination_type == 'load_more_button' || pagination_type == 'infinite_scroll') { $(document).ready(function() { if($('.woocommerce-pagination').length) { $('.woocommerce-pagination').before('
Load More Products
'); if(pagination_type == 'infinite_scroll') { $('#sb-infinite-scroll-load-more').addClass('sb-hide'); } } $('.woocommerce-pagination').addClass('sb-hide'); $('ul.products li.product').addClass('sb-added'); }); $('body').on('click', '#sb-infinite-scroll-load-more a', function(e) { e.preventDefault(); if($('.woocommerce-pagination a.next').length && $('#sb-infinite-scroll-load-more a').attr('sb-processing')!='1') { $('#sb-infinite-scroll-load-more a').attr('sb-processing', 1); var href = $('.woocommerce-pagination a.next').attr('href'); sbwis.onstart(); $('#sb-infinite-scroll-load-more').hide(); $('.woocommerce-pagination').before('
 Loading...
'); $.get(href, function(response) { $('.woocommerce-pagination').html($(response).find('.woocommerce-pagination').html()); $(response).find('ul.products li.product').each(function() { $('ul.products li.product:last').after($(this)); }); $('#sb-infinite-scroll-loader').remove(); $('#sb-infinite-scroll-load-more').show(); $('#sb-infinite-scroll-load-more a').attr('sb-processing', 0); sbwis.onfinish(); $('ul.products li.product').not('.sb-added').addClass('animated fadeIn').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() { $(this).removeClass('animated fadeIn').addClass('sb-added'); }); if($('.woocommerce-pagination a.next').length == 0) { $('#sb-infinite-scroll-load-more').addClass('finished').removeClass('sb-hide'); $('#sb-infinite-scroll-load-more a').show().html('No more products available...').css('cursor', 'default'); } }); } else { $('#sb-infinite-scroll-load-more').addClass('finished').removeClass('sb-hide'); $('#sb-infinite-scroll-load-more a').show().html('No more products available...').css('cursor', 'default'); } }); } if(pagination_type == 'infinite_scroll') { var buffer_pixels = Math.abs(50); w.scroll(function () { if($('ul.products').length) { var a = $('ul.products').offset().top + $('ul.products').outerHeight(); var b = a - w.scrollTop(); if ((b - buffer_pixels) 0) // If Internet Explorer, return version number return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie))); return false; }, lazyload_init: function() { w.scroll(function () { sbwis.trigger_load(); }); sbwis.trigger_load(); }, trigger_load: function() { $(".sb-lazy-img").each(function () { sbwis.lazyload($(this)); }); }, lazyload: function(e) { var threshold = Math.abs(50); var a = e.offset().top; var b = a - w.scrollTop(); if ((b - threshold)