// 隐藏全部: function hideall(){ $('#href_2').hide(); $('#href_3').hide(); $('#href_4').hide(); $('#href_5').hide(); $('#href_6').hide(); $('#href_7').hide(); $('#href_8').hide(); $('#href_9').hide(); $('#href_10').hide(); $('#href_2').css({'height':'0'}); $('#href_3').css({'height':'0'}); $('#href_4').css({'height':'0'}); $('#href_5').css({'height':'0'}); $('#href_6').css({'height':'0'}); $('#href_7').css({'height':'0'}); $('#href_8').css({'height':'0'}); $('#href_9').css({'height':'0'}); $('.line_2').hide(); $('.line_3').hide(); $('.line_4').hide(); $('.line_5').hide(); $('.line_6').hide(); $('.line_7').hide(); $('.line_8').hide(); $('.line_9').hide(); } $('#to_2').mouseover(function(){ hideall(); $('#href_2').show(); $('.line_2').show(); $('#href_2').animate({height:0+305},500); }); $('#to_3').mouseover(function(){ hideall(); $('#href_3').show(); $('.line_3').show(); $('#href_3').animate({height:0+378},500); }); $('#to_4').mouseover(function(){ hideall(); $('#href_4').show(); $('.line_4').show(); $('#href_4').animate({height:0+305},500); }); $('#to_5').mouseover(function(){ hideall(); $('#href_5').show(); $('.line_5').show(); $('#href_5').animate({height:0+305},500); }); $('#to_6').mouseover(function(){ hideall(); $('#href_6').show(); $('.line_6').show(); $('#href_6').animate({height:0+305},500); }); $('#to_7').mouseover(function(){ hideall(); $('#href_7').show(); $('.line_7').show(); $('#href_7').animate({height:0+305},500); }); $('#to_8').mouseover(function(){ /*hideall(); $('.line_8').show();*/ hideall(); $('#href_8').show(); $('.line_8').show(); $('#href_8').animate({height:0+305},500); }); $('#to_9').mouseover(function(){ /*hideall(); $('.line_9').show();*/ hideall(); $('#href_9').show(); $('.line_9').show(); $('#href_9').animate({height:0+305},500); }); $('#to_10').mouseover(function(){ hideall(); $('#href_10').show(); $('.line_10').show(); $('#href_10').animate({height:0+305},500); }); $('#href_2').mouseleave(function(){ hideall(); }); $('#href_3').mouseleave(function(){ hideall(); }); $('#href_4').mouseleave(function(){ hideall(); }); $('#href_5').mouseleave(function(){ hideall(); }); $('#href_6').mouseleave(function(){ hideall(); }); $('#href_7').mouseleave(function(){ hideall(); }); $('#href_8').mouseleave(function(){ hideall(); }); $('#href_9').mouseleave(function(){ hideall(); }); $('#href_10').mouseleave(function(){ hideall(); }); $('#deelon_logo_fixed').mouseover(function(){ hideall(); }); // 公司动态 客户合作 js345线路检测学堂 的鼠标放置切换 function noneall(){ $('#reportdiv').hide(); $('#reportdiv_2').hide(); $('#reportdiv_3').hide(); $('#reporttext_1').css("color","white"); $('#reporttext_2').css("color","white"); $('#reporttext_3').css("color","white"); } $('#dlreport_1').mouseover(function(){ noneall(); $('#reportdiv').show(); $('#reporttext_1').css("color","red"); }); $('#dlreport_2').mouseover(function(){ noneall(); $('#reportdiv_2').show(); $('#reporttext_2').css("color","red"); }); $('#dlreport_3').mouseover(function(){ noneall(); $('#reportdiv_3').show(); $('#reporttext_3').css("color","red"); }); go_1(); function go_1(){ //当前高亮显示的页签索引 var index = 0; var timer = null; //获取所有的页签和要切换的内容 var list = $('.reportnews_list li'); //遍历每一个页签并且给他们绑定事件 for(var i = 0; i < list.length; i++) { list[i].id = i; } //添加定时器前做一次清除,避免多个定时器导致页面卡顿 if(timer) { clearInterval(timer); timer = null; } //添加定时器,改变当前高亮的索引 timer = setInterval(autoPlay, 5000); function autoPlay() { index++; if(index >= list.length) { index = 0; } changeOption(index); } function changeOption(curIndex) { // console.log(curIndex); for(var j = 0; j < list.length; j++) { list[j].className = ''; } //高亮显示当前 if (list[curIndex]){ list[curIndex].className = 'active'; title = list[curIndex].children[0].innerHTML; document.getElementById('reportdiv_text').innerHTML = title; index = curIndex; } } } go_2(); function go_2(){ //当前高亮显示的页签索引 var index = 0; var timer = null; //获取所有的页签和要切换的内容 var list = $('.reportnews_list_2 li'); var lista = $('.reportnews_list_2 li a'); //遍历每一个页签并且给他们绑定事件 for(var i = 0; i < list.length; i++) { list[i].id = i; } //添加定时器前做一次清除,避免多个定时器导致页面卡顿 if(timer) { clearInterval(timer); timer = null; } //添加定时器,改变当前高亮的索引 timer = setInterval(autoPlay2, 5000); function autoPlay2() { index++; if(index >= list.length) { index = 0; } changeOption(index); } function changeOption(curIndex) { // console.log(curIndex); for(var j = 0; j < list.length; j++) { list[j].className = ''; lista[j].style.color = 'white'; } //高亮显示当前 // list[curIndex].className = 'active'; // list[curIndex].style.color = 'red'; if (lista[curIndex]){ lista[curIndex].style.color = 'red'; title = list[curIndex].children[0].innerHTML; document.getElementById('reportdiv_text_2').innerHTML = title; index = curIndex; } } } go_3(); function go_3(){ //当前高亮显示的页签索引 var index = 0; var timer = null; //获取所有的页签和要切换的内容 var list = $('.reportnews_list_3 li'); var lista = $('.reportnews_list_3 li a'); //遍历每一个页签并且给他们绑定事件 for(var i = 0; i < list.length; i++) { list[i].id = i; } //添加定时器前做一次清除,避免多个定时器导致页面卡顿 if(timer) { clearInterval(timer); timer = null; } //添加定时器,改变当前高亮的索引 timer = setInterval(autoPlay3, 5000); function autoPlay3() { index++; if(index >= list.length) { index = 0; } changeOption(index); } function changeOption(curIndex) { // console.log(curIndex); for(var j = 0; j < list.length; j++) { list[j].className = ''; lista[j].style.color = 'white'; } //高亮显示当前 // list[curIndex].className = 'active'; // list[curIndex].style.color = 'red'; if (lista[curIndex]){ lista[curIndex].style.color = 'red'; title = list[curIndex].children[0].innerHTML; document.getElementById('reportdiv_text_3').innerHTML = title; index = curIndex; } } }