var mySwiper = new Swiper('.swiper-container', { autoplay: 5000, pagination : '.swiper-pagination', });$('.productList img').each(function(index,element){ var img = new Image(); img.src = element.src; var _element = element; img.onload = function(){ $(_element).parent().css('height',_element.width+3 + 'px'); if(img.height > img.width){ var sub = _element.height - _element.width; _element.style.paddingLeft = parseInt(sub/4) + 'px'; _element.style.paddingRight = parseInt(sub/4) + 'px'; } else{ var sub = _element.width - _element.height; _element.style.paddingTop = parseInt(sub/4) + 'px'; _element.style.paddingBottom = parseInt(sub/4) + 'px'; } } });$('#scrollToTop').bind('touchstart', function () { $('body,html').animate({scrollTop: 0}, 500); }); $(window).scroll(function() { if($(window).scrollTop() > 200){ $('#scrollToTop').show();/*.lea-wa-popover*/ }else{ $('#scrollToTop').hide(); } });