if (typeof $ != "undefined"){ ;$(function(){ var win = $(window); var isie = !!window.activexobject; var isie6 = isie && !window.xmlhttprequest; var isie8 = isie && !!document.documentmode; var isie7 = isie && !isie6 && !isie8; //点击高亮 $('.even_ul').each(function(){ $(this).children('li:even').addclass('even_li'); }); // //标签导航 // $(".tab_nav dd a:first").addclass("tab_light"); $(".tab_box > div").hide(); $(".tab_box > div:first").show(); $('.tab_nav dd a').click(function(){ $(this).addclass('tab_light').siblings().removeclass('tab_light'); $(".tab_box > div").hide().eq($('.tab_nav dd a').index(this)).fadein(); }); // // flash if ($().slide) { // $(".ibn").slide({maincell:".bd",titcell:".hd",effect:"leftloop", vis:"auto",autopage: true, autoplay: true, pnloop:true, delaytime: 500, intertime: 5000}); }; // end flash // top $("#js_top").click(function(e){ $("html,body").animate({scrolltop: 0},500); e.preventdefault(); }); // // funhead (function(){ var win = $(window); var header = $("#header"); if (header.length>0 && header.hasclass("tofixed")) { var headertop = header.offset().top, headerheight = header.height(), headerfixedtop = headertop + headerheight; var headerwrap = $("#headerwrap"); headerwrap.length>0 ? function(){headerwrap.height(headerheight);}() : 0; win.on("load scroll resize", function(){ $(this).scrolltop() >= headerfixedtop ? function () {!header.hasclass("header_fixed") ? header.addclass("header_fixed") : 0;}() : function(){header.removeclass("header_fixed")}(); if(isie6){ var scrollt = $(this).scrolltop(); scrollt >= headerfixedtop ? function () {header.css({"top": scrollt + "px"});}() : function () {header.css({"top": "0px"});}(); }; }); }; if (isie) { $(".hnavitem:last-child").addclass("last_hnavitem"); $(".hnavitem").mouseenter(function(){ $(this).addclass("hnavitem_hover"); }).mouseleave(function(){ $(this).removeclass("hnavitem_hover"); }); }; })(); // end funhead }); //文本框 function placeholder(input){ var placeholder = input.attr("placeholder"), defaultvalue = input.defaultvalue; if(!defaultvalue){ input.val() == "" ? input.val(placeholder).addclass("phcolor") : 0; } input.focus(function(){ input.val() == placeholder ? $(this).val("") : 0; }); input.blur(function(){ input.val() == "" ? $(this).val(placeholder).addclass("phcolor") : 0; }); input.keydown(function(){ $(this).removeclass("phcolor"); }); } ;$(function(){ supportplaceholder="placeholder"in document.createelement("input"); if(!supportplaceholder){ $("input").each(function(){ var type = $(this).attr("type"); text = $(this).attr("placeholder"); if(type == "text" || type == "number" || type == "search" || type == "email" || type == "date" || type == "url"){ placeholder($(this)); } }); } }); //end文本框 }; // end jq