// javascript document $(document).ready(function(){ openfun();gonggao();plist_con();product(); }); /*下拉菜单*/ function dropmenu(obj){ $(obj).each(function(){ var thespan = $(this); var themenu = thespan.find(".submenu"); var tarheight = themenu.height(); themenu.css({height:0,opacity:0}); var t1; function expand() { cleartimeout(t1); thespan.find('a').addclass("selected"); themenu.stop().show().animate({height:tarheight,opacity:1},200); } function collapse() { cleartimeout(t1); t1 = settimeout(function(){ thespan.find('a').removeclass("selected"); themenu.stop().animate({height:0,opacity:0},200,function(){ $(this).css({display:"none"}); }); }, 250); } thespan.hover(expand, collapse); themenu.hover(expand, collapse); }); } $(document).ready(function(){ dropmenu(".drop-menu-effect"); }); /*weixin js*/ $(function(){ $(".weixin").mouseenter(function(){ $(this).children(".wx_zicaidan").show(); }); $(".weixin").mouseleave(function(){ $(this).children(".wx_zicaidan").hide(); }); }); /*banner js*/ function openfun(){ banner($("#pic ul li"),$("#ben span"),"on",1000); banner($("#researchpic ul li"),$("#researchben span"),"on",1000); } function banner(picimg,picpage,picon,pictime){ var demo; var currentindex=0; var currentid=0; var pictureid=0; var len = picimg.length; if(len > 1){ antoscroll(); picpage.hover(function(){ stopscrolll(); currentid=$(this).attr("id"); pictureid= currentid.substring(currentid.length-1); picimg.eq(pictureid).fadein("fast"); picimg.not(picimg[pictureid]).fadeout("fast"); picpage.eq(pictureid).addclass(picon); picpage.not(picpage[pictureid]).removeclass(picon); },function(){ currentid=$(this).attr("id"); pictureid= currentid.substring(currentid.length-1); currentindex = pictureid; antoscroll(); }); }else{ picimg.eq(0).fadein(pictime); picpage.eq(0).addclass(picon); stopscrolll(); }; function antoscroll(){ picpage.eq(currentindex).addclass(picon); picpage.eq(currentindex-1).removeclass(picon); picimg.eq(currentindex).fadein(pictime); picimg.eq(currentindex-1).fadeout(pictime); currentindex++; currentindex= currentindex>=len?0:currentindex; demo= settimeout(antoscroll,7000); } function stopscrolll(){ cleartimeout(demo); } }; /*向上滚动公告栏*/ function gonggao(){ var list = $("#gonggao"); var li = $("#gonggao ul li"); var len = li.length; if(len > 0 ){ if (len > 1){ list.jcarousellite({ visible:1, // 显示图片数量 auto:3000, //是否自动滚动,填写毫秒,null为不自动 speed: 1000, //滚动时长 circular: true, //是否重复播放,首尾相接 start:0, //从第几个开始滚动,默认第一个 speed: 1000, //滚动完成时长 单位毫秒 scroll: 1 , // 每次滚动图片数量 vertical: true, //滚动方向true为垂直,false为水平 beforestar:null, //滚动前调用函数 afterend:null //滚动后调用函数 }); }else{ list.jcarousellite({ visible:len, // 显示图片数量 auto:null, //是否自动滚动,填写毫秒,null为不自动 speed: 3000, //滚动时长 circular: false, //是否重复播放,首尾相接 start:0, //从第几个开始滚动,默认第一个 speed: 1000, //滚动完成时长 单位毫秒 scroll: 1 , // 每次滚动图片数量 vertical: true, //滚动方向true为垂直,false为水平 beforestar:null, //滚动前调用函数 afterend:null //滚动后调用函数 }); }; }; }; /*左右图片滚动*/ function plist_con(){ var li = $("#plist_con ul li"); var list = $("#plist_con"); var len = li.length; if (len > 0) { if (len >= 1){ list.jcarousellite({ btnprev: "#plist_perv", //上一张按钮 btnnext: "#plist_next", //下一张按钮 visible:1, // 显示图片数量 auto:5000, //是否自动滚动,填写毫秒,null为不自动 speed: 5000, //滚动时长 circular: true, //是否重复播放,首尾相接 start:0, //从第几个开始滚动,默认第一个 speed: 1000, //滚动完成时长 单位毫秒 scroll: 1 , // 每次滚动图片数量 vertical: false, //滚动方向true为垂直,false为水平 beforestar:null, //滚动前调用函数 afterend:null //滚动后调用函数 }); }else{ list.jcarousellite({ btnprev: "#plist_perv", //上一张按钮 btnnext: "#plist_next", //下一张按钮 visible:len, // 显示图片数量 auto:null, //是否自动滚动,填写毫秒,null为不自动 speed: 5000, //滚动时长 circular: false, //是否重复播放,首尾相接 start:0, //从第几个开始滚动,默认第一个 speed: 5000, //滚动完成时长 单位毫秒 scroll: 1 , // 每次滚动图片数量 vertical: false, //滚动方向true为垂直,false为水平 beforestar:null, //滚动前调用函数 afterend:null //滚动后调用函数 }); }; }; }; function product(){ var li = $("#cp_title_ben ul li"); var con = $("#cp_content ul li"); var len = con.length; var swidth = $("#cp_content").width(); var len = $("#cp_content ul li").length; var index = 0; var pictimer; $("#cp_title_ben ul li").mouseenter(function() { index = $("#cp_title_ben ul li").index(this); showpics(index); }).eq(0).trigger("mouseenter"); $("#cp_content ul").css("width",swidth * (len + 1)); $("#cp_content").hover(function() { clearinterval(pictimer); },function() { pictimer = setinterval(function() { if(index == len) { showfirpic(); index = 0; } else { showpics(index); } index++; },4000); }).trigger("mouseleave"); function showpics(index) { var nowleft = -index*swidth; $("#cp_content ul").stop(true,false).animate({"left":nowleft},500); $("#cp_title_ben ul li").removeclass("on").eq(index).addclass("on"); } function showfirpic() { $("#cp_content ul").append($("#cp_content ul li:first").clone()); var nowleft = -len*swidth; $("#cp_content ul").stop(true,false).animate({"left":nowleft},500,function() { $("#cp_content ul").css("left","0"); $("#cp_content ul li:last").remove(); }); $("#cp_title_ben ul li").removeclass("on").eq(0).addclass("on"); } }; /*tab切换代码*/ function etabit(btn,len){ var idname = new string(btn.id); var s = idname.indexof("_"); var e = idname.lastindexof("_")+1; var tabname = idname.substr(0, s); var id = parseint(idname.substr(e, 1)); var tabnumber = len;//btn.parentnode.childnodes.length; for(i=0;i 1){ var time=setinterval('timer(".notice_active")',3500); $('.gg_more a').mousemove(function(){ clearinterval(time); }).mouseout(function(){ time = setinterval('timer(".notice_active")',3500); }); } $(".news_ck").click(function(){ location.href = $(".notice_active .notice_active_ch").children(":input").val(); }) }); /*返回顶部*/ function gotopex(){ var obj=document.getelementbyid("gotopbtn"); function getscrolltop(){ return document.documentelement.scrolltop; } function setscrolltop(value){ document.documentelement.scrolltop=value; } window.onscroll=function(){getscrolltop()>0?obj.style.display="":obj.style.display="none";} obj.onclick=function(){ var gotop=setinterval(scrollmove,10); function scrollmove(){ setscrolltop(getscrolltop()/1.1); if(getscrolltop()<1)clearinterval(gotop); } } } /*搜索框 */ (function($) { // handle click on toggle search button $('#toggle-search').mouseover(function() { $('#search-form, #toggle-search').toggleclass('open'); return false; }); // handle click on search submit button $('#search-form input[type=submit]').mouseover(function() { $('#search-form input, #toggle-search').toggleclass('open'); return true; }); // clicking outside the search form closes it $(document).click(function(event) { var target = $(event.target); if (!target.is('#toggle-search') && !target.closest('#search-form').size()) { $('#search-form, #toggle-search').removeclass('open'); } }); })(jquery);