$(function(){ $('.ali-product-tabs li.ali-product-tab').each(function(e){ var pic1 = $(this).find('.tab-img').attr('src'), pic2 = $(this).find('.tab-img1').attr('src'); $(this).find('.ali-img').css({'background-image':'url('+pic1+')'}); $(this).find('.ali-img1').css({'background-image':'url('+pic2+')'}); if($(this).hasclass('active')){ $(this).find('.ali-img').hide(); $(this).find('.ali-img1').show(); } $(this).click(function(){ $(this).addclass('active'); $(this).siblings().removeclass('active'); //$('.ali-product-content:eq('+e+')').addclass('active').css({'display':'block','opacity':'1'}); //$('.ali-product-content:eq('+e+')').siblings().removeclass('active').css({'display':'none','opacity':'0'}); $('.data-slide ul').css('transform','translatex(-' + e*1200 + 'px)'); $(this).find('.ali-img').hide(); $(this).find('.ali-img1').show(); $(this).siblings('li').find('.ali-img').show(); $(this).siblings('li').find('.ali-img1').hide(); }); }); bannerslide(); $(window).resize(function(){ bannerslide(); }); function bannerslide() { console.log($(document).width()) var documentwidth = $(document).width(), sy = 0; $('#banner-wrap').width(documentwidth * 3 + 'px'); $('#banner-wrap .banner-page').width(documentwidth + 'px'); /*$('#banner-wrap').hover(function(){ $('#banner-wrap a.prev').show(); $('#banner-wrap a.next').show(); }, function() { $('#banner-wrap a.prev').hide(); $('#banner-wrap a.next').hide(); }); */ $('.dk-banner a.prev').click(function(){ var _index = 0; $('#banner-wrap .banner-page').each(function(e){ if($(this).hasclass('active')){ _index = e; } }); if(sy > 0) sy -= 1; console.log('_index9999999=====', sy) // $('#banner-wrap .banner-page').eq(0).addclass('active').siblings('.banner-page').removeclass('active'); // $('#banner-wrap .banner-page').eq(0).css({'opacity': 1,'height': 'auto'}); // $('#banner-wrap .banner-page').eq(1).css({'opacity': 0}); // $('#banner-wrap .banner-page').eq(2).css({'opacity': 0}); if(sy == 0 || sy == 1) { $('#banner-wrap .banner-page').eq(0).css({'opacity': 1,'height': 'auto'}); $('#banner-wrap .banner-page').eq(1).css({'opacity': 1,'height': 'auto'}); } if(sy >= 0) { // $('#banner-wrap').css('transform','translatex(0)'); $('#banner-wrap').css('transform','translatex(-' + documentwidth * sy + 'px)'); } }); $('.dk-banner a.next').click(function(){ var _index = 0; $('#banner-wrap .banner-page').each(function(e){ if($(this).hasclass('active')){ _index = e; } }); if(sy < 2) sy += 1; console.log('_index=====',_index, sy) // $('#banner-wrap .banner-page').eq(1).addclass('active').siblings('.banner-page').removeclass('active'); // $('#banner-wrap .banner-page').eq(0).css({'opacity': 0,'height': '100px'}); // $('#banner-wrap .banner-page').eq(1).css({'opacity': 1}); // $('#banner-wrap .banner-page').eq(2).css({'opacity': 1}); if(sy == 2) { $('#banner-wrap .banner-page').eq(0).css({'opacity': 0,'height': '100px'}); $('#banner-wrap .banner-page').eq(1).css({'opacity': 0,'height': '100px'}); } if(sy <= 2) { $('#banner-wrap').css('transform','translatex(-' + documentwidth * sy + 'px)'); } }); } $('#fbivideo').click(function(){ var video = document.getelementbyid('bannervideo'); $('#fixed-dialog').show(); video.play(); }); $('#video-box-wrap .close-video').click(function(){ $('#fixed-dialog').hide(); }); $('.data-slide a.prev').click(function(){ var index = 0; $('.ali-product-tabs li.ali-product-tab').each(function(e){ if($(this).hasclass('active')){ index = e; } }); if(index != 0) { $('.ali-product-tab').eq(index-1).addclass('active').siblings('.ali-product-tab').removeclass('active'); $('.ali-product-tab').eq(index-1).find('.ali-img').hide(); $('.ali-product-tab').eq(index-1).find('.ali-img1').show(); $('.ali-product-tab').eq(index-1).siblings('li').find('.ali-img').show(); $('.ali-product-tab').eq(index-1).siblings('li').find('.ali-img1').hide(); $('.data-slide ul').css('transform','translatex(-' + (index - 1)*1200 + 'px)'); } }); $('.data-slide a.next').click(function(){ var index = 0; $('.ali-product-tabs li.ali-product-tab').each(function(e){ if($(this).hasclass('active')){ index = e; } }); if(index != 4) { $('.ali-product-tab').eq(index+1).addclass('active').siblings('.ali-product-tab').removeclass('active'); $('.ali-product-tab').eq(index+1).find('.ali-img').hide(); $('.ali-product-tab').eq(index+1).find('.ali-img1').show(); $('.ali-product-tab').eq(index+1).siblings('li').find('.ali-img').show(); $('.ali-product-tab').eq(index+1).siblings('li').find('.ali-img1').hide(); $('.data-slide ul').css('transform','translatex(-' + (index + 1)*1200 + 'px)'); } }); $('.ali-product-tabs li.ali-product-tab:eq(0)').click(function(){ $('.indicator-triangle').css({'left':'110px'}); }); $('.ali-product-tabs li.ali-product-tab:eq(1)').click(function(){ $('.indicator-triangle').css({'left':'350px'}); }); $('.ali-product-tabs li.ali-product-tab:eq(2)').click(function(){ $('.indicator-triangle').css({'left':'590px'}); }); $('.ali-product-tabs li.ali-product-tab:eq(3)').click(function(){ $('.indicator-triangle').css({'left':'830px'}); }); $('.ali-product-tabs li.ali-product-tab:eq(4)').click(function(){ $('.indicator-triangle').css({'left':'1070px'}); }); $('.common-topbar-site-switch').hover(function(){ $(this).find('.topbar-site-switch-dropdown').show(); },function(){ $(this).find('.topbar-site-switch-dropdown').hide(); }); $('.all-nav').hover(function(){ $(this).find('img').attr('src','statics/images/imgs/hover_03.png'); $('.nav_line').hide(); },function(e){ $(this).find('img').attr('src','statics/images/imgs/icon_03.png'); $('.nav_line').show(); }); var boxw = $(window).width(); $('.menu .ul1 li .box').width(boxw); $('.ul1-li').each(function(){ $(this).hover(function(){ $(this).find('.category-item').css({'opacity':'1'}); $(this).siblings().find('.category-item').css({'opacity':'0'}); $('.nav_line').show(); },function(){ $(this).find('.category-item').css({'opacity':'1'}); $('.nav_line').hide(); }); }); $('.index-box-row li').each(function(e){ $(this).click(function(){ $('.ban-con:eq('+e+')').show(); $('.ban-con:eq('+e+')').siblings().hide(); /*$(this).addclass('bortop'); $(this).siblings().removeclass('bortop');*/ var owrap=document.getelementbyid("himg1"); var aimg=owrap.getelementsbytagname("img"); var imax=4; for(var i=0;i n){ i = 0; } slide(i); timer = window.settimeout(autoroll, offset); } function slide(i){ jquery('.index-box-row li').eq(i).addclass('active').siblings().removeclass('active'); jquery('.index-box-row li').eq(i).find('.bortop').addclass('active').siblings().find('.bortop').removeclass('active'); jquery('.index-top-banner .ban-con').eq(i).css('display','block').siblings('.index-top-banner .ban-con').css('display','none'); } function hookthumb(){ jquery('.index-box-row li').hover( function () { if (timer) { cleartimeout(timer); i = jquery(this).prevall().length; slide(i); } }, function () { timer = window.settimeout(autoroll, offset); this.blur(); return false; }); } function hookimg(){ jquery('.ban-con').hover( function () { if (timer) { cleartimeout(timer); i = jquery(this).prevall().length; slide(i); } }, function () { timer = window.settimeout(autoroll, offset); this.blur(); return false; }); } /*首页幻灯*/