/*微梦企业网站系统php版 http://www.wmweb.cc*/ new wow().init(); //导航 var timeout = 500; var closetimer = 0; var ddmenuitem = 0; function dropmenu_open(){ dropmenu_canceltimer(); dropmenu_close(); ddmenuitem = $(this).find('ul').eq(0).css('display', 'block'); } function dropmenu_close(){ if(ddmenuitem) ddmenuitem.css('display', 'none'); } function dropmenu_timer(){ closetimer = window.settimeout(dropmenu_close, timeout); } function dropmenu_canceltimer(){ if(closetimer){ window.cleartimeout(closetimer); closetimer = null; } } $(document).ready(function(){ $('.nav > li').bind('mouseover', dropmenu_open); $('.nav > li').bind('mouseout', dropmenu_timer); }); document.onclick = dropmenu_close; //pc侧栏+二级展开 (function($) { $.fn.menu = function(b) { var c, item, httpadress; b = jquery.extend({ speed: 220, autostart: 1, autohide: 1 }, b); c = $(this); item = c.children("ul").parent("li").children("em"); httpadress = window.location; item.addclass("inactive"); function _item() { var em = $(this); if (b.autohide) { em.parent().parent().find(".active").parent("li").children("ul").slideup(b.speed / 1.2, function() { $(this).parent("li").children("em").removeattr("class"); $(this).parent("li").children("em").attr("class", "inactive") }) } if (em.attr("class") == "inactive") { em.parent("li").children("ul").slidedown(b.speed, function() { em.removeattr("class"); em.addclass("active") }) } if (em.attr("class") == "active") { em.removeattr("class"); em.addclass("inactive"); em.parent("li").children("ul").slideup(b.speed) } } item.unbind('click').click(_item); if (b.autostart) { c.children("em").each(function() { if (this.href == httpadress) { $(this).parent("li").parent("ul").slidedown(b.speed, function() { $(this).parent("li").children(".inactive").removeattr("class"); $(this).parent("li").children("em").addclass("active") }) } }) } } })(jquery); //侧栏当前 function left_active(){ if(document.getelementbyid("cat_active"+catid)!=null){ document.getelementbyid("cat_active"+catid).classname="category_active" }else{ try{ var tid=document.getelementbyid('side_menu').getelementsbytagname('a')[0].id; document.getelementbyid(tid).classname="category_current"; }catch(e) { console.log(e); } } if(document.getelementbyid("small"+catid)!=null){ document.getelementbyid("small"+catid).style.display="block"; }else{ if(document.getelementbyid("small"+pid)!=null)document.getelementbyid("small"+pid).style.display="block"; } } window.onload=left_active; $(document).ready(function (){ //pc侧栏+二级展开 $(".sec_li").parents(".sec_ul").siblings("em").show(); $(".side_menu li").menu(); //替换br var ad_p = $(".br"); for (var i = 0; i < ad_p.length; i++) { var temp = $(ad_p[i]).html().replace(/\n/g,'
'); $(ad_p[i]).html(temp); }; $("video").attr("preload",""); //$("video").attr("autoplay","autoplay"); //移除img的title $("img").attr("title",""); }); $(window).bind("load",function(){ //适配图片高度 var imgh = $(".imgh img").eq(0).height(); $(".imgh img").height(imgh); });