$(function(){ $(".search-submit").click(function(event){ $(this).removeAttr("name"); event.preventDefault(); if(window.location.href.indexOf("key")>-1){return} var val = $.trim($(".search-title").val()); var type=$(".typebox .type").text(); var act=$(".wp-search").find("form").attr("action") if(val!==""){ if(act.indexOf("?")>-1){act=act.split("?")[0]} act=act+"?type="+encodeURI(type)+"&key="+encodeURI(val); $(".wp-search").find("form").attr("action",act).submit() //$(".wp-search").find("form").submit(); }else{ alert("请输入关键词"); } return false; }); $(".wp-search .typebox").hover(function(){ $(this).find(".type-list").stop(true,true).slideDown(400) },function(){ $(this).find(".type-list").stop(true,true).slideUp(400) }) $(".wp-search .typebox .option").click(function(){ var tx=$(this).text(); $(".wp-search .type").text(tx); $(".wp-search .typebox .type-list").hide() }) /*导航*/ /*$.fn.sudyNav = function(){}; $(".wp-menu li").hover(function() { $(this).siblings().find('.sub-menu').stop(true,true).slideUp(150) $(this).children('.sub-menu').stop(true,true).slideDown(200); $(this).addClass('hover'); }, function() { $(this).children('.sub-menu').stop(true,true).slideUp(150); $(this).removeClass('hover'); }); $(".wp-menu li").each(function(){ $(this).children(".menu-switch-arrow").appendTo($(this).children(".menu-link")); });*/ /*媒体链接*/ $(".shares li").each(function(){ $(this).children("a").hover(function(){ $(this).parent().find(".con").stop(true,true).fadeIn(); },function(){ $(this).parent().find(".con").stop(true,true).fadeOut(); }); }); });