$(function(){ $(".serachsubmit").click(function(event){ var val=$(".search_box .searchkeyword").val(); console.log(val) var a2=$(".search_box").find("form").attr("action") if(a2.indexof('keyword')){ a2=a2.split("&keyword=")[0] } var a3=a2+'&keyword='+val $(".search_box").find("form").attr("action",a3); $(this).removeattr("name"); event.preventdefault(); var val = $.trim($(".searchkeyword").val()); if(val!==""){ $(".search_box").find("form").submit(); }else{ alert("请输入关键词"); } return false; }); $(".col_metas .col_path a").eq(0).attr("target","_blank") //回到顶部 $(".sidenav .gototop").click(function(){ $(".main_wrap").animate({scrolltop:0},600,function(){ $(".body_b,.topbox,.main1,.main2").removeclass("showdiv"); $(".body_home").addclass("showdiv") }) }) if($(window).width()>500){ $("#totop").click(function(){ $(".main .body_b").animate({"scrolltop":0},500) ; $(".list .b_list").animate({"scrolltop":0},500) }) }else{ $("#totop").click(function(){ $("body.main").animate({"scrolltop":0},500) ; $(".list .b_list").animate({"scrolltop":0},500) }) } $(".site-lang ul li.links").on("mouseenter",function(){ $(this).addclass("hover"); }).on("mouseleave",function(){ $(this).removeclass("hover"); }) $("#wp_paging_w6 .wp_paging a.first span").text("首页") $("#wp_paging_w6 .wp_paging a.prev span").text("上一页") $("#wp_paging_w6 .wp_paging a.next span").text("下一页") /*导航*/ /*$.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")); });*/ $(".possplit").text("—") $(".serbtn").click(function(){ $('.layer').addclass('on') }) $('.layer .close').click(function(){ $('.layer').removeclass('on') }) $(".navbtn").click(function(){ $('.namall').addclass('on') }) $('.namall .close').click(function(){ $('.namall').removeclass('on') }) /*媒体链接*/ $(".footer .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(); }); }); $(document).ready(function(){ screen = window.screen; if (window.screen.width < 999) { $(".navi-aside-toggle").text("菜单") } }); });