$(function(){ $(".fullSearch .search-submit").click(function(event){ $(this).removeAttr("name"); event.preventDefault(); var val = $.trim($(".search-title").val()); if(val!==""){ $(".search").find("form").submit(); }else{ alert("请输入关键词"); } return false; }); $(".searchbox .openSearch").click(function(){ $(".fullSearch").slideDown(400) }) $(".fullSearch .close").click(function(){ $(".fullSearch").slideUp(400) }) IEVersion(); function IEVersion() { var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器 var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器 var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; if(isIE) { var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); reIE.test(userAgent); var fIEVersion = parseFloat(RegExp["$1"]); if(fIEVersion == 7) { alert("检测到您的浏览器内核版本过低,无法达到完美的浏览体验,请使用新版本浏览器浏览!") } else if(fIEVersion == 8) { alert("检测到您的浏览器内核版本过低,无法达到完美的浏览体验,请使用新版本浏览器浏览!") } else if(fIEVersion == 9) { alert("检测到您的浏览器内核版本过低,无法达到完美的浏览体验,请使用新版本浏览器浏览!") } else if(fIEVersion == 10) { return 10; } else { return 6;//IE版本<=7 } } else if(isEdge) { return 'edge';//edge } else if(isIE11) { return 11; //IE11 }else{ return -1;//不是ie浏览器 } } /*导航*/ /*$.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")); });*/ $(window).scroll(function(){ var t=$(window).scrollTop(); if(t>400){ $(".topbox").addClass("fix") }else{ $(".topbox").removeClass("fix") } }) if($(window).width()<1800){ $(".nav .wp-menu .menu-item").each(function(){ var i=$(this).attr("class").split(" i")[1]; $(this).find("ul").css("left",i*50-10) }) } /*媒体链接*/ $(".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(); }); }); //toTop if($(window).width()>479){ $("#toTop").click(function(){ $(".main .body_b").animate({"scrollTop":0},500) ; $(".list .b_list").animate({"scrollTop":0},500) }) }else{ $("#toTop").click(function(){ console.log(123) $("body.main").animate({"scrollTop":0},500) ; $(".list .b_list").animate({"scrollTop":0},500) }) } $(".wp_artfuns .wp_art_adjoin .prev").children().remove() $(".wp_artfuns .wp_art_adjoin .prev").text("上一篇"); $(".wp_artfuns .wp_art_adjoin .next").children().remove() $(".wp_artfuns .wp_art_adjoin .next").text("下一篇"); //$(".list .listTop").append("
") }); $(document).ready(function(){ $(".ckxq").hover(function(){ $(".tc").show(); }); $(".gb").click(function(){ $(".tc").hide(); }); $("body").click(function(e){ if (!$(e.target).closest(".ckxq").length) { $(".tc").hide(); } }); });