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); } }