function test1(){ var tempStr=document.getElementById('test').value; if(tempStr=="请输入关键字进行搜索") { document.getElementById('test').value=""; } } function test2(){ var tempStr=document.getElementById('test').value; if(tempStr=="") { document.getElementById('test').value="请输入关键字进行搜索"; } } $(function(){ //导航 $(".nav ul li #nav").hide(); $("li.mainmenu").hover(function(){ $(this).find("#nav").stop(true,true); $(this).find("#nav").slideDown(); },function(){ $(this).find("#nav").stop(true,true); $(this).find("#nav").slideUp(); }); $(document).ready(function(){ $(".nav ul li").hover(function(){ $(this).addClass('cur').siblings().removeClass('cur'); }); }); //banner jQuery(".slideBox1").slide({mainCell:".bd ul",autoPlay:true}); jQuery(".slideBox2").slide({mainCell:".bd ul",autoPlay:true}); jQuery(".slideBox3").slide({mainCell:".bd ul",autoPlay:true}); jQuery(".slideBox4").slide({mainCell:".bd ul",autoPlay:true}); jQuery(".slideBox5").slide({mainCell:".bd ul",autoPlay:true}); jQuery(".slideBox6").slide({mainCell:".bd ul",effect:"left",autoPlay:true}); jQuery(".twoLisImg").slide({mainCell:".bd ul",autoPlay:true}); //师资队伍 jQuery(".picScroll-top").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"topLoop",autoPlay:true,vis:2}); //学院风光 jQuery(".picScroll-left").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"leftLoop",autoPlay:true,vis:5}); //tab切换 $(document).ready(function(){ var $tab_li = $('.tab_menu li'); $tab_li.hover(function(){ $(this).addClass('selected').siblings().removeClass('selected'); var index = $tab_li.index(this); $('div.tab_box > div').eq(index).show().siblings().hide(); }); }); //下拉选框 $(function(){ $(".select").each(function(){ var s=$(this); var z=parseInt(s.css("z-index")); var dt=$(this).children("dt"); var dd=$(this).children("dd"); var _show=function(){dd.slideDown(200);dt.addClass("cur");s.css("z-index",z+1);}; //展开效果 var _hide=function(){dd.slideUp(200);dt.removeClass("cur");s.css("z-index",z);}; //关闭效果 dt.click(function(){dd.is(":hidden")?_show():_hide();}); dd.find("a").click(function(){dt.html($(this).html());_hide();}); //选择效果(如需要传值,可自定义参数,在此处返回对应的“value”值 ) $("body").click(function(i){ !$(i.target).parents(".select").first().is(s) ? _hide():"";}); }) }); });