var current = '1' // $("#nav .item a").click(function() { // $(this).addclass("active").parent().siblings().find('a').removeclass("active"); // var val = $(this).html(); // if (val == '关于万安') { // $("#nav2").css('display', 'block') // } else { // $("#nav2").css('display', 'none') // $("#nav2 .item a").removeclass("active"); // } // console.log(val) // }) let tablist = [ {"list":[ {'url':"./group_profile.html","title":"集团简介","isactive":false}, {'url':"/index.html","title":"下属公司","isactive":false}, {'url':"./leader_speech","title":"领导致辞","isactive":false}, {'url':"./history.html","title":"发展历程","isactive":false}, {'url':"./group_honor.html","title":"集团荣誉","isactive":false}, {'url':"/index.html","title":"组织架构","isactive":false}, ]}, {"list":[ {'url':"./new_list.html","title":"集团新闻","isactive":false}, {'url':"./index.html","title":"行业咨询","isactive":false}, ]}, {"list":[ {'url':"./group_profile.html","title":"产品介绍","isactive":false}, {'url':"./product_application.html","title":"产品应用","isactive":false}, {'url':"./index.html","title":"技术指南","isactive":false}, {'url':"./index.html","title":"塑粉概述","isactive":false}, {'url':"./index.html","title":"质量信用报告","isactive":false}, ]}, {"list":[ {'url':"./new_list.html","title":"服务理念","isactive":false}, {'url':"./index.html","title":"营销网络","isactive":false}, {'url':"./index.html","title":"合作伙伴","isactive":false}, ]}, {"list":[ {'url':"./new_list.html","title":"集团理念","isactive":false}, {'url':"./index.html","title":"集团内刊","isactive":false}, {'url':"./index.html","title":"集团发展","isactive":false}, {'url':"./index.html","title":"集团活动","isactive":false}, ]}, {"list":[ {'url':"./new_list.html","title":"人才理念","isactive":false}, {'url':"./index.html","title":"招聘岗位","isactive":false}, ]}, {"list":[ {'url':"./new_list.html","title":"联系总部","isactive":false}, {'url':"./index.html","title":"下属企业","isactive":false}, {'url':"./index.html","title":"各办事处","isactive":false}, {'url':"./index.html","title":"投诉建议","isactive":false}, ]}, ] $("#nav2 .item a").click(function() { $(this).addclass("active").parent().siblings().find('a').removeclass("active"); }) $("#nav2 .item a").mouseover(function() { $(this).addclass("active").parent().siblings().find('a').removeclass("active"); }) // $("#nav .item a").mouseover(function() { // $(this).addclass("active").parent().siblings().find('a').removeclass("active"); // var val = $(this).attr('ids'); // if(val != 0){ // val = number(val) - 1; // console.log(val) // $("#nav2").css('display', 'block') // setnav(val); // } // // if (val == '关于万安') { // // $("#nav2").css('display', 'block') // // setnav(0); // // } else { // // $("#nav2").css('display', 'none') // // $("#nav2 .item a").removeclass("active"); // // } // }) $('#nav .item a').each(function (e) { $(this).stop().mouseover(function () { $(this).addclass('active2'); if(e!=0){ var val = number(e)-1; $('#nav2').addclass('hide'); $('.navbar').addclass('hide'); $('.navbar').eq(0).removeclass('hide'); $('.navbar').eq(8).removeclass('hide'); // $('#nav2').eq(val).removeclass('hide'); $('.navbar').eq(e).removeclass('hide'); $('.navbar').eq(e).mouseleave(function () { $('.navbar').eq(e).addclass('hide'); }); }else{ $('.navbar').addclass('hide'); $('.navbar').eq(0).removeclass('hide'); $('.navbar').eq(8).removeclass('hide'); } }); $(this).stop().mouseleave(function () { $(this).removeclass('active2'); }); }); function setnavaatice(){ //子导航位置对应 var nav = $("#nav .item"); nav.each(function(e){ if(e>0){ var childnav = $(".child-nav"); var left; if(e==1){ left = -96; }else if(e==2){ left = -68; }else if(e==3) { left = -288; }else if(e==4){ left = -96; }else if(e>=5){ left = 0; } left = left+'px'; $(childnav[e-1]).find("ul").css({"position":"relative","left":left}); } // $($(".nav-type-"+e)).css('position','absolute'); // $(childnav[e]).css('left','60px'); }) } setnavaatice(); function setnav(index){ var list = tablist[index].list; var itemstr = ''; for(var i=0;i'+list[i].title+'' }else{ itemstr += '
  • '+list[i].title+'
  • ' } } $('#navmenu').html(itemstr) $("#nav2 .item a").click(function() { $(this).addclass("active").parent().siblings().find('a').removeclass("active"); }) } // $("#nav .item a").mouseleave(function(){ // $(this).addclass("active").parent().siblings().find('a').removeclass("active"); // var val = $(this).html(); // if(val=='关于万安'){ // $("#nav2").css('display','block') // }else{ // $("#nav2").css('display','none') // $("#nav2 .item a").removeclass("active"); // } // }) function initmargin(){ var pagename = window.location.pathname; if(pagename.indexof('leader_speech')!=-1){ $(".main-content").css('paddingbottom','35px') console.log("???"); } } initmargin(); $(".tc-close-btn").on("click", function() { $(".tc-bg").addclass('hide'); }) window.onload = function() { $("#nav-box .navbar-nav>li>a").on("click", function() { $('#nav-box .navbar-collapse').collapse('hide'); }) //点击关于我们 $("#jp_about").click(function() { }); } // bodyscale(); //设置领导致辞页面内容边距 function setmaincss(){ var pathname = location.pathname; if(pathname.lastindexof('leader_speech.php')!=-1){ var maincontent = $(".main-content"); maincontent.css("paddingtop",'39px'); maincontent.css("paddingleft",'56px'); maincontent.css("width",'1100px'); $(".leaderspeech-val-bg").css("width",'988px'); } } //设置签名img位置 function setimgposition(){ var main = $(".main-content p"); if(main.length>0){ main.each(function(){ var align = $(this).attr('align'); var mainfind = main.find('a') if(mainfind.length&&!align){ mainfind.css({'text-align':align}) } if(align=='left'||align=='right'||align=='center'){ $(this).css({'text-align':align,'margin-top':'5px'}); } }) } } setmaincss(); setimgposition(); // 监听事件 window.addeventlistener('scroll', function(){ let t = $('body, html').scrolltop(); // 目前监听的是整个body的滚动条距离 if(t>0){ $('#nav-box').addclass('box-active') }else{ $('#nav-box').removeclass('box-active') } // if(t==0){ // new wow().init(); // } }) //获取鼠标位置 function mouseposition(ev){ if(ev.pagex || ev.pagey){ return {x:ev.pagex, y:ev.pagey}; } return { x:ev.clientx + document.body.scrollleft - document.body.clientleft, y:ev.clienty + document.body.scrolltop - document.body.clienttop }; } document.onmousemove = mousemove; //鼠标向下移动,取消子导航栏显示 function mousemove(ev){ ev = ev || window.event; var mousepos = mouseposition(ev); if(mousepos.y>158){ var navbar = $(".navbar"); if(navbar.find('#menu').length){ navbar.each(function(index){ var hideexist = $(this).hasclass('hide'); if(index>0&&!hideexist&&index<=7){ $(this).addclass('hide'); } }) } } } function setaotumain(){ var listmainli = $(".main-banner-bg-li"); var listleft = $(".main-banner-bg-left-box"); var listright = $(".main-banner-bg-right-box"); var listactive = 'main-banner-bg-li-active'; var maxlength = listmainli.length-1; listleft.click(function(){ listmainli.each(function(index){ if ($(this).hasclass(listactive)) { var oindex = index+1; if(oindex>maxlength){ oindex = 0; }else if(oindex<=0){ oindex = 0; } listmainli.css('display','none'); listmainli.removeclass(listactive); $(listmainli[oindex]).fadein('fast',function(){ $(this).addclass(listactive); }); return; } }) }) listright.click(function(){ listmainli.each(function(index){ if ($(this).hasclass(listactive)) { var oindex = index-1; if(index<=0){ oindex = maxlength; } listmainli.css('display','none'); listmainli.removeclass(listactive); $(listmainli[oindex]).fadein('fast',function(){ $(this).addclass(listactive); }); return; } }) }) var time = null; time = setinterval(function(){ listmainli.each(function(index){ if ($(this).hasclass(listactive)) { var oindex = index-1; if(index<=0){ oindex = maxlength; } listmainli.css('display','none'); listmainli.removeclass(listactive); $(listmainli[oindex]).fadein('fast',function(){ $(this).addclass(listactive); }); } }) },8000) } $(document).ready(function(){ setaotumain(); }) //function setheight() { // var height = $("#home #productimg").height() // console.log(height) // $("#pruduct2").css("height", height + 'px') // // //} //settimeout(setheight(),1000)