$(function(){ //后期加 // $('.about_con02 .link_a').hover(function(){ // $(this).find('a').fadein(); // },function(){ // $(this).find('a').fadeout(); // }); // $(document).on('click','.innova_con01 dl',function(){ // if($(this).find('dd').css('display')=='none'){ // $(this).find('dd').show(); // }else{ // $(this).find('dd').hide(); // } // }) if(ispc()){ if($('div').hasclass('mscrol')){ $(".mscrol").mcustomscrollbar({ theme:"rounded-dots", autohidescrollbar:true }); } }else{ $(".mscrol").addclass('overy'); } if(ispc()){ $(".about_mscroll2").mcustomscrollbar({ theme:"rounded-dots" }); $('.zc_bg').addclass('pc_about'); $('.zc_bg').css({'top':$('.add_relative').height(),'opacity':0}); $('.link_a').mouseenter(function(e){ $('.zc_bg').animate({ 'top':'0', 'opacity':'1' },500,function(){ $(".about_mscroll2").mcustomscrollbar("update"); }); e.stoppropagation(); }); $(document).on('click','.zc_con',function(e){ e.stoppropagation(); }); $(document).on('mouseenter','.zc_colse,.pc_about .shu_ico',function(){ $('.zc_bg').animate({ 'top':$('.add_relative').height(), 'opacity':'0' },500); }) }else{ $('.zc_bg').hide(); $(".about_mscroll2").addclass('overy'); $('.link_a').click(function(e){ $('.zc_bg').css({ 'opacity':'1' }).fadein(); e.stoppropagation(); }); $(document).on('click','.zc_con',function(e){ e.stoppropagation(); }); $(document).on('click','.zc_colse',function(){ $('.zc_bg').fadeout(); }) $(document).on('click',function(){ $('.zc_bg').fadeout(); }) } if(ispc()){ $('.ssgs').hover(function(){ $(this).find('dl').show(); },function(){ $(this).find('dl').hide(); }); }else{ $('.ssgs a').click(function(e){ if($(this).parent().find('dl').css('display')=='none'){ e.preventdefault(); $(this).parent().find('dl').show(); }else{ $(this).parent().find('dl').hide(); } }); } $('.nav_btn').addclass('anim'); $('.nav_btn').hover(function(){ $(this).removeclass('anim'); },function(){ $(this).addclass('anim'); }); //后期加结束 var oldindex=0; if(!ispc()){ $('body').addclass('phone_body'); $('video').attr('src',''); } var windowh=$(window).height(); var windoww=$(window).width(); //首页js if($('body').hasclass('index_body')){ $('.scrollpage0').css({ 'height':windowh }); //logo入场效果 if(ispc()){ $('.index_header .nav_btn').animate({ 'height':$('.header').height() },700,'easeinquad',function(){ $('.index_header .nav_btn span').delay(200).animate({ 'opacity':'1' }); if(windoww>1366){ $('.index_header .logo').delay(200).animate({ 'opacity':'1', 'width':'300px' },700,'easeinquad',function(){ $('.index_header .logo img').addclass('tran') }); }else{ $('.index_header .logo').delay(200).animate({ 'opacity':'1', 'width':'140px' },700,'easeinquad',function(){ $('.index_header .logo img').addclass('tran') }); } }); } //文字初始化 if(ispc()){ $('.in_con01 h3').css({ 'position':'relative', 'top':'-50px', 'opacity':'0' }); $('.in_con01 .more01').css({ 'position':'relative', 'left':'-50px', 'opacity':'0' }); $('.in_con01 .more02').css({ 'position':'relative', 'right':'-50px', 'opacity':'0' }); } //文字入场动画 if(ispc()){ $('.in_con01 h3').delay(500).animate({ 'top':'0px', 'opacity':'1' },1000,function(){ $('.in_con01 .more01').animate({ 'position':'relative', 'left':'0px', 'opacity':'1' }); $('.in_con01 .more02').animate({ 'position':'relative', 'right':'0px', 'opacity':'1' }); }); } //首页整屏滚动效果 if(ispc()){ $('body').removeclass('w1200'); var nowpage = 0; var lock = true; $("body,html").stop().animate({ scrolltop: 0 }, 1000); $(document).mousewheel(function(e,delta){ if(lock){ if(delta>0){nowpage--}else{nowpage++} if(nowpage >1){nowpage = 1;return false;}else if(nowpage < 0){nowpage = 0;return false;} lock = false; $("body,html").stop().animate({ scrolltop: $(".scrollpage" + nowpage).offset().top}, 600,function(){ lock = true; }); } e.preventdefault(); }); }else{ $('body').addclass('w1200'); } //首页整屏滚动效果结束 $('.video_p1 .video_img').hide(); $('.video_p1 video').on('ended',function(){ $('.video_p1 .video_img').show(); }); //首屏视频,与图片全屏展示 if(ispc()){ mainbgresize1($('.spage0_video video'),windoww,windowh,1920,1080); mainbgresize1($('.video_img'),windoww,windowh,1920,1080); }else{ mainbgresize1($('.spage0_video .phone_dom'),windoww,windowh,1920,1080); } //新闻 $('.in_news ul').bxslider({ 'auto':false, 'controls':false, 'pager':true }); //第二屏设置宽高 $('.in_con02,.in_con02_bg').css({ 'height':windowh, 'width':windoww, 'left':-windoww }); //点击切换第二屏 $(document).on('click','.in_con01 .more01',function(){ $('.index_btn li').eq(1).addclass('hover').siblings().removeclass('hover'); two_page(); }); //设置第三屏 $('.in_con03,.in_con03_bg').css({ 'height':windowh, 'width':windoww, 'left':-windoww }); //点击切换第三屏 $(document).on('click','.in_con01 .more02',function(){ $('.index_btn li').eq(2).addclass('hover').siblings().removeclass('hover'); three_page(); }) //设置第四屏 $('.in_con04,.in_con04_bg').css({ 'height':windowh, 'width':windoww, 'left':-windoww }); //点击切换三屏幕 $('.index_btn li').eq(0).click(function(){ $(this).addclass('hover').siblings().removeclass('hover'); $('.scrollpage0>.spage0_video video').attr({ 'src':$(this).data('src') }); delete_three_two(); }); $('.index_btn li').eq(1).click(function(){ $(this).addclass('hover').siblings().removeclass('hover'); two_page(); }); $('.index_btn li').eq(2).click(function(){ $(this).addclass('hover').siblings().removeclass('hover'); three_page(); }); $('.index_btn li').eq(3).click(function(){ $(this).addclass('hover').siblings().removeclass('hover'); four_page(); }); //销毁第二三屏 function delete_three_two(){ $('.in_con02_bg').delay(200).animate({ 'left':'-100%' },500,'easeinquad'); $('.in_con02').animate({ 'left':'-100%' },500,'easeinquad',function(){ $('.in_con02,.in_con02_bg').css('zindex','99'); }) $('.in_con03_bg').delay(200).animate({ 'left':'-100%' },500,'easeinquad'); $('.in_con03').animate({ 'left':'-100%' },500,'easeinquad',function(){ $('.in_con03,.in_con03_bg').css('zindex','99'); }) $('.in_con04_bg').delay(200).animate({ 'left':'-100%' },500,'easeinquad'); $('.in_con04').animate({ 'left':'-100%' },500,'easeinquad',function(){ $('.in_con04,.in_con04_bg').css('zindex','99'); }) } //切换第二屏函数 function two_page(){ $('.in_con03,.in_con03_bg').css('zindex','99'); $('.in_con04,.in_con04_bg').css('zindex','99'); $('.in_con02,.in_con02_bg').css('zindex','100'); $('.in_con02_bg').animate({ 'left':'0' },1000,'easeinquad'); $('.in_con02').delay(200).animate({ 'left':'0' },1000,'easeinquad',function(){ $('.scrollpage0>.spage0_video video').attr('src',''); $('.in_con03,.in_con03_bg').css({ 'left':'-100%', 'zindex':'99' }); $('.in_con04,.in_con04_bg').css({ 'left':'-100%', 'zindex':'99' }); //初始化其他按钮状态 $('.in_con02 .con02_ul li').find('em').delay(400).stop().animate({ 'right':'-100%' }); $('.in_con02 .con02_ul li').removeclass('no_background'); $('.in_con02 .con02_ul li').find('i').stop().animate({ 'opacity':0 },300,function(){ $(this).parent('li').css({ 'overflow':'hidden' }); }); //切换第二屏后播放第一个视频 var ovsrc=$('.in_con02 .con02_ul li').eq(0).data('src'); $('.in_con02 .con02_tab').children('div').css({ 'opacity':'0', 'z-index':'1' }); $('.in_con02 .con02_tab').children('div').eq(0).css({ 'opacity':'1', 'z-index':'2' }); $('.in_con02 .con02_tab').children('div').eq(0).find('video').attr('src',ovsrc); $('.in_con02 .con02_ul li').eq(0).find('em').stop().animate({ 'right':0 },400,function(){ $(this).parent('li').css({ 'overflow':'initial' }); }); $('.in_con02 .con02_ul li').eq(0).find('i').stop().delay(400).animate({ 'opacity':1 },500,function(){ $(this).parents('li').addclass('no_background'); c2_colck=true; }); //切换第二屏后播放第一个视频结束 //第二屏三个切换按钮的移入效果 var c2_colck=true; $(document).on('mouseenter','.in_con02 .con02_ul li',function(){ //$('.con02_ul li').hover(function(){ //移入当前按钮效果 if(c2_colck){ c2_colck=false; $(this).find('em').stop().animate({ 'right':0 },400,function(){ $(this).parent('li').css({ 'overflow':'initial' }); }); $(this).find('i').delay(400).stop().animate({ 'opacity':1 },500,function(){ $(this).parents('li').addclass('no_background'); c2_colck=true; }); //移入初始化其他按钮 $(this).siblings().find('em').delay(400).stop().animate({ 'right':'-100%' }); $(this).siblings().removeclass('no_background'); $(this).siblings().find('i').stop().animate({ 'opacity':0 },300,function(){ $(this).parent('li').css({ 'overflow':'hidden' }); }); //移入内容切换 var vsrc=$(this).data('src'); $('.in_con02 .con02_tab').children('div').eq($(this).index()).animate({ 'opacity':'1', 'z-index':'2' },function(){ //加入视频地址 if(oldindex!=$(this).index()){ if(ispc()){ $('.in_con02 .con02_tab').children('div').eq($(this).index()).find('video').attr('src',vsrc); } } oldindex=$(this).index(); }).siblings().animate({ 'opacity':'0', 'z-index':'1' },function(){ //清除其他视频地址 $('.in_con02 .con02_tab').children('div').eq($(this).index()).find('video').attr('src',''); }); } }); }); } //切换第三屏函数 function three_page(){ $('.in_con02,.in_con02_bg').css('zindex','99'); $('.in_con04,.in_con04_bg').css('zindex','99'); $('.in_con03,.in_con03_bg').css('zindex','100'); mainbgresize1($('.spage0_img img.img7'),windoww,windowh,1920,1080); $('.in_con03_bg').animate({ 'left':'0' },1000,'easeinquad'); $('.in_con03').delay(200).animate({ 'left':'0' },1000,'easeinquad',function(){ $('.scrollpage0>.spage0_video video').attr('src',''); //第二屏初始化 $('.in_con02,.in_con02_bg').css({ 'left':'-100%', 'zindex':'99' }); $('.in_con04,.in_con04_bg').css({ 'left':'-100%', 'zindex':'99' }); }) } //切换第四屏函数 function four_page(){ $('.in_con02,.in_con02_bg').css('zindex','99'); $('.in_con03,.in_con03_bg').css('zindex','99'); $('.in_con04,.in_con04_bg').css('zindex','100'); $('.in_con04_bg').animate({ 'left':'0' },1000,'easeinquad'); $('.in_con04').delay(200).animate({ 'left':'0' },1000,'easeinquad',function(){ $('.scrollpage0>.spage0_video video').attr('src',''); //第三屏初始化 $('.in_con03,.in_con03_bg').css({ 'left':'-100%', 'zindex':'99' }); $('.in_con02,.in_con02_bg').css({ 'left':'-100%', 'zindex':'99' }); //设置第四屏 var ovsrc=$('.index_btn li').eq(3).data('src'); $('.in_con04 .spage0_video').find('video').attr('src',ovsrc); $(document).on('click','.c04_video_btn li',function(e){ $('.c04_vi_bg').fadein().find('video').attr('src',$(this).data('src')); e.stoppropagation(); }); $(document).on('click',function(){ $('.c04_vi_bg').fadeout().find('video').attr('src',''); }); $(document).on('click','.c04_vi_con .close_btn',function(){ $('.c04_vi_bg').fadeout().find('video').attr('src',''); }); $(document).on('click','.c04_vi_con',function(e){ e.stoppropagation(); }); //第四屏两个切换按钮的移入效果 // $(document).on('mouseenter','.con02_ul li',function(){ $('.in_con04 .con02_ul.c04_video_btn li').hover(function(){ //移入当前按钮效果 $(this).find('em').stop().animate({ 'right':0 },400,function(){ $(this).parent('li').css({ 'overflow':'initial' }); }); $(this).find('i').delay(400).stop().animate({ 'opacity':1 },500,function(){ $(this).parents('li').addclass('no_background'); c2_colck=true; }); },function(){ $(this).find('em').delay(400).stop().animate({ 'right':'-100%' }); $(this).find('i').parent('li').css({ 'overflow':'hidden' }); $(this).removeclass('no_background'); $(this).find('i').stop().animate({ 'opacity':0 },300,function(){ $(this).parent('li').css({ 'overflow':'hidden' }); }); }); }) } } //全局input模拟placeholder initevent('.holder'); //头部中英文切换 // $(document).on('click','.header .language',function(e){ // $(this).find('.con').fadetoggle() // e.stoppropagation(); // }); // $(document).on('click',function(){ // $('.header .language').find('.con').fadeout() // }); //导航高度计算 $(window).resize(function(){ $('.nav').css({ 'height':$(window).height()-$('.n_logo').height()-$('.slide_nav .share').height() }); $('.nav li>a').css({ 'height':($('.nav').height()-10)/8, 'line-height':$('.nav').height()/8+'px' }) $('.slide_nav ul li>a span').css({ 'height':($('.nav').height()-10)/8 }); $('.slide_nav ul li>a q').css({ 'height':($('.nav').height()-10)/8 }); }).resize(); //导航滚动条 // $(".nav").mcustomscrollbar({ // theme:"rounded-dots", // autohidescrollbar:true // }); if(ispc()){ $(".nav").mcustomscrollbar({ theme:"rounded-dots", autohidescrollbar:true }); $(document).on('mouseleave','.slide_nav ul',function(){ $(".nav").mcustomscrollbar("update"); }); }else{ $(".nav").addclass('overy'); } //if(ispc()){ // $('.slide_nav ul li').click(function(){ // $(this).addclass('activ'); // $(this).find('dl').stop().slidedown(1,function(){ // $(".nav").mcustomscrollbar("update"); // }) // },function(){ // $(this).removeclass('activ'); // $(this).find('dl').stop().slideup(1,function(){ // $(".nav").mcustomscrollbar("update"); // }) // }); $('.slide_nav ul li>a q').click(function(e){ e.preventdefault(); // $('.slide_nav ul li').removeclass('activ'); // $('.slide_nav ul li dl').stop().slideup(400,function(){ // $(".nav").mcustomscrollbar("update"); // }) // $(this).parents('li').addclass('activ'); // $(this).parents('li').find('dl').stop().slidedown(400,function(){ // $(".nav").mcustomscrollbar("update"); // }) if($(this).parents('li').hasclass('activ')){ $('.slide_nav ul li').removeclass('activ'); $('.slide_nav ul li dl').stop().slideup(400,function(){ $(".nav").mcustomscrollbar("update"); }) }else{ $('.slide_nav ul li').removeclass('activ'); $('.slide_nav ul li dl').stop().slideup(400,function(){ $(".nav").mcustomscrollbar("update"); }) $(this).parents('li').addclass('activ'); $(this).parents('li').find('dl').stop().slidedown(400,function(){ $(".nav").mcustomscrollbar("update"); }) } }); // }else{ // $('.slide_nav ul li').click(function(e){ // if($(this).find('dl').size()>0){ // if($(this).find('dl').css('display')=='none'){ // e.preventdefault(); // e.stoppropagation(); // $(this).find('dl').slidedown(300); // } // } // }); // } //导航点击事件 $(document).on('click','.header .nav_btn',function(e){ $(this).animate({ 'opacity':'0' }); $('.logo').animate({ 'left':'-50px', 'opacity':0 }); $('.slide_nav').delay(100).animate({ 'left':'0', 'opacity':'1' }); e.stoppropagation(); }); $(document).on('click','.crumb .nav_btn',function(e){ $('.slide_nav').delay(100).animate({ 'left':'0', 'opacity':'1' }); e.stoppropagation(); }); $(document).on('click','.slide_nav .nav_colse',function(e){ var l_width=$('.slide_nav').width(); $('.slide_nav').animate({ 'left':'-'+l_width, 'opacity':'0' }); $('.header .nav_btn').delay(250).animate({ 'opacity':'1' }); $('.logo').animate({ 'left':0, 'opacity':1 },200); e.stoppropagation(); }); $(document).on('click','.slide_nav',function(e){ e.stoppropagation(); }); $(document).on('click',function(){ var l_width=$('.slide_nav').width(); $('.slide_nav').animate({ 'left':'-'+l_width, 'opacity':'0' }); $('.header .nav_btn').delay(250).animate({ 'opacity':'1' }); $('.logo').animate({ 'left':0, 'opacity':1 },200); }); $(document).on('click','#bdshare_weixin_qrcode_dialog',function(e){ e.stoppropagation(); }); //导航滚动事件 $(window).scroll(function(){ var scrollt=$(this).scrolltop(); if(scrollt>=100){ $('.header').addclass('other_header') $('.crumb').addclass('other_crumb'); if(windoww>1024){ $('.crumb').next('div').css({ 'margintop':$('.crumb').height() }); } }else{ $('.header').removeclass('other_header') $('.crumb').removeclass('other_crumb').css({ 'left':'0' }); $('.crumb').next('div').css({ 'margintop':0 }); } }); //手机端搜索事件 $(document).on('click','.phone_search_btn',function(e){ $('.phone_search_bg').fadein(); e.stoppropagation(); }); $(document).on('click','.phone_search input',function(e){ e.stoppropagation(); }); $('.p_s_clo').click(function(e){ $('.phone_search_bg').fadeout(); e.stoppropagation(); }); //产品详情 if($('div').hasclass('pro_con')){ var sync1 = $("#sync1"); var sync2 = $("#sync2"); sync1.owlcarousel({ autoplay:true, singleitem : true, slidespeed : 1000, navigation: true, pagination:false, afteraction : syncposition, responsiverefreshrate : 200, navigationtext:["",""] }); sync2.owlcarousel({ items : 4, pagination:false, responsiverefreshrate : 110, itemstablet:[768,4], itemsmobile:[479,2], afterinit : function(el){ el.find(".owl-item").eq(0).addclass("synced"); } }); function syncposition(el){ var current = this.currentitem; $("#sync2") .find(".owl-item") .removeclass("synced") .eq(current) .addclass("synced") if($("#sync2").data("owlcarousel") !== undefined){ center(current) } } $("#sync2").on("click", ".owl-item", function(e){ e.preventdefault(); var number = $(this).data("owlitem"); sync1.trigger("owl.goto",number); }); function center(number){ var sync2visible = sync2.data("owlcarousel").owl.visibleitems; var num = number; var found = false; for(var i in sync2visible){ if(num === sync2visible[i]){ var found = true; } } if(found===false){ if(num>sync2visible[sync2visible.length-1]){ sync2.trigger("owl.goto", num - sync2visible.length+2) }else{ if(num - 1 === -1){ num = 0; } sync2.trigger("owl.goto", num); } } else if(num === sync2visible[sync2visible.length-1]){ sync2.trigger("owl.goto", sync2visible[1]) } else if(num === sync2visible[0]){ sync2.trigger("owl.goto", num-1) } } } if($('div').hasclass('pro_con02')){ $('.pro_con02 ul').bxslider({ 'auto':true, 'captions':true, 'pager':false }); } //产品详情图片轮播 if($('div').hasclass('bxslider_pro03')){ bank_1($('.bxslider_pro03'),4,20); } if($('div').hasclass('bxslider_pro03')){ bank_1($('.bxslider_pro04'),4,20); } //产品详情结束 //三排 $('.p_c_con02_list dl:nth-of-type(3n)').addclass('n3'); $('.case_list .right_con dl:nth-of-type(3n)').addclass('n3'); $('.program_con .p_con04 dd:nth-of-type(3n)').addclass('n3'); $('.news_con02 .dl dl:nth-of-type(3n)').addclass('n3'); $('.news_down_img dl:nth-of-type(3n)').addclass('n3'); $('.program_con07 dl:nth-of-type(3n)').addclass('n3'); //四排 $('.news_down dl:nth-of-type(4n)').addclass('n4'); //两排 $('.tech_con02 .dl dl:nth-of-type(2n)').addclass('n2'); $('.tech_con03 .dl dl:nth-of-type(2n)').addclass('n2'); //最后 $('.innova_con01 dl').last().addclass('last-child'); //网站地图 maxheight($('.map_con .other_dl dd')); //新闻中心 if($('div').hasclass('news_c01_img')){ $('.news_bxslider').bxslider({ 'controls':false, onsliderload:function(){ if($('.news_bxslider').find('li').not('.bx-clone').size()==1){ $('.news_c01_img .bx-controls').hide(); } }, onslidebefore:function($slider,nindex,oindex){ $('.news_c01_text dl').delay(100).animate({ 'left':'0', 'opacity':'0' },200).fadeout(100); $('.news_c01_text dl').eq(oindex).animate({ 'left':'40px', 'opacity':'1' },200).fadein(); } }); } if(ispc()){ $('.news_con03 .tab li').hover(function(){ $(this).addclass('active').siblings().removeclass('active'); $('.news_con03 .tab_con .dl').eq($(this).index()).show().siblings().hide(); }); }else{ $('.news_con03 .tab li').click(function(e){ if($('.news_con03 .tab_con .dl').eq($(this).index()).css('display')=='none'){ e.preventdefault(); e.stoppropagation(); $(this).addclass('active').siblings().removeclass('active'); $('.news_con03 .tab_con .dl').eq($(this).index()).show().siblings().hide(); } }) } //企业文化 if($('div').hasclass('about_scroll')){ var t=0,sc=0; $(window).scroll(function(){ sc=$(window).scrolltop(); if(sc+windowh>=$('.footer').offset().top && tdiv',function(){ $('.f_con05>div').removeclass('hover'); $(this).toggleclass('hover'); }) $(document).on('click','.footer .f_con05>div h3 span',function(e){ e.stoppropagation(); $(this).parents('.f_c05_a').removeclass('hover') }); //产业滚动效果 if($('div').hasclass('scroll_lock')){ var crumbli=$('.crumb_con ul li'); var fixed_navli=$('.fixed_nav li'); $(window).scroll(function(){ var scrollto=$(window).scrolltop(); $('.scroll_lock').each(function (index, ele) { if(windoww>1024){ if(scrollto>=$(this).offset().top-500){ crumbli.eq(index).addclass('active').siblings().removeclass('active'); fixed_navli.eq(index).addclass('active').siblings().removeclass('active'); }; }else if(windoww>windowh && windoww==1024){ if(scrollto>=$(this).offset().top-windowh/2){ crumbli.eq(index).addclass('active').siblings().removeclass('active'); fixed_navli.eq(index).addclass('active').siblings().removeclass('active'); }; }else if(windoww=$(this).offset().top-windowh/8){ crumbli.eq(index).addclass('active').siblings().removeclass('active'); fixed_navli.eq(index).addclass('active').siblings().removeclass('active'); }; }else if(windoww=$(this).offset().top-windowh/4){ crumbli.eq(index).addclass('active').siblings().removeclass('active'); fixed_navli.eq(index).addclass('active').siblings().removeclass('active'); }; } }) if(scrollto+windowh>=$('.footer').offset().top+100 && windoww>=1100){ $('.fixed_nav').fadeout(); }else{ $('.fixed_nav').fadein(); } }) if(isfirefox()){ $(window).scroll(); } $(document).on('click','.crumb_con ul li',function(){ nav_click($(this)) }); $(document).on('click','.fixed_nav li',function(){ nav_click($(this)) }); } //产品详情 tab $('.pro_con_nav li').on('click',function(){ $('.pro_tab').find('.pro_tab_con').hide(); $('.pro_con_nav li').removeclass('active') $('.pro_tab').find('.pro_tab_con').eq($(this).index()).show(); $(this).addclass('active') }); }) function nav_click($this){ var li_text=$.trim($this.find('a').text()); var con_top; settimeout(function(){ $this.addclass('active').siblings().removeclass('active'); },50); $('.scroll_lock').each(function (index, ele) { if($.trim($(this).find('.h3').text())==li_text){ con_top=$(this).offset().top-80 } }) $("html,body").stop().animate({ scrolltop: con_top }, 500); } function bank_1(obj,numb,m_right) { obj.each(function (index, element) { var obj = $(this) var num = numb; obj.find(".bx-clone").remove() obj.find("ul li,ul").attr({ "style": "" }) var ulhtml = obj.find("ul") obj.remove(".bx-wrapper"); obj.html(ulhtml); if($(window).width()<1000) num=2; if($(window).width()<768) m_right=10; if($(window).width()<768) num=2; var xl = obj.width() / num; if (obj.find("ul li").size() >= num) { obj.find("ul").bxslider({ infiniteloop: true, auto: false, mode: 'horizontal', minslides: num, maxslides: num, moveslides: 1, slidewidth: xl, pager:false, controls:true, slidemargin:m_right, }); } }); }