let totalMarginTop = 420; $(function(){ // changeGoodsFont() let window_width = $(window).width(); if(window_width > 768){ $('body').css('overflow','hidden'); $('html').on("mousewheel DOMMouseScroll", function (e) { totalMarginTop = totalMarginTop + e.originalEvent.deltaY; console.log(totalMarginTop); // console.log(e.originalEvent.deltaY) if(totalMarginTop >= 520){ totalMarginTop = 520; $('body').css('overflow','auto'); // $('html').unbind('mousewheel DOMMouseScroll'); } else if(totalMarginTop < 220){ totalMarginTop = 220; } else if($(window).scrollTop() === 0){ $('body').css('overflow','hidden'); } let tempMarginTop = - totalMarginTop; $('.product-big-img').css('margin-top',tempMarginTop + 'px'); }) } $('.firstRow>td').text('').css('border-right','none'); $('.firstRow>td:first-child').text('鎶€鏈寚鏍?); }) $(window).resize(function(){ // changeGoodsFont() }) function changeGoodsFont(){ let baseWidth = 1900; let windowWidth = $(window).width(); if(windowWidth <= 768){ return } if(windowWidth >= baseWidth){ windowWidth = baseWidth; } let baseTop = 145; let baseFontSize = 161; let baseHeight = 810; let newFontSize = baseFontSize * windowWidth / baseWidth; let newHeight = baseHeight * windowWidth / baseWidth; let baseLineHeight = 201; let newLineHeight = baseLineHeight * windowWidth / baseWidth; let newTop = baseTop * windowWidth / baseWidth; $('.sub-banner-font2').css({'font-size':newFontSize + 'px','line-height':newLineHeight + 'px','top':newTop + 'px'}); $('.product-big-img').css({'height':newHeight + 'px'}); } let ProductWidth = 0; $(function(){ setHideWidth() // $(window).resize(function(){ // setHideWidth() // }) }) function setHideWidth(){ $('.product-bottom-list').css({'display':'flex','position':'absolute','visibility':'hidden'}); let ProductHeight = $('.product-bottom-list').height(); ProductWidth = $('.product-bottom-list').width(); $('.product-bottom-list').removeAttr('style'); $('.product-bottom-list').css({'height':ProductHeight + 'px','display':'flex','width':0}); } function openList(obj){ if(!$(obj).hasClass('on')){ $(obj).addClass('on'); $(obj).parent().parent().addClass('show'); $('.product-bottom-list').css({'width':ProductWidth + 'px'}); setTimeout(function(){ $('.product-bottom-list a').css({'transition-delay':'0','transition':'0.3s'}) },3000); } } function showMobile(obj){ if(!$(obj).hasClass('on')){ $(obj).addClass('on'); $('.mobile-product-list-box').slideDown(500); } }