fontSize(); $(window).resize(function () { fontSize(); }); function fontSize() { var size; var winW = $(window).width(); if (winW <= 1500 && winW > 767) { size = Math.round(winW / 15); } else if (winW <= 767) { size = Math.round(winW / 4.6); } else if (winW <= 340) { size = 50; } else { size = 100; } $('html').css({ 'font-size': size + 'px' }) } $(function() { $("body").css("visibility","visible"); var w =$(window).width(); var e = window, a = 'inner'; if (!('innerWidth' in window )) { a = 'client'; e = document.documentElement || document.body; } var $w = e[ a+'Width']; $('.t_search').click(function(){ $('.search_wrap').fadeIn(); $('.search_wrap .search_box').slideDown() }); $('.close,.bck').click(function(){ $('.search_wrap').fadeOut(); $('.search_wrap .search_box').slideUp() }); if($w>=1024){ $(window).scroll(function(){ if($(window).scrollTop()>$(".slick_bar").height()){ $(".aside_link").fadeIn() }else{ $(".aside_link").fadeOut() } }) } var ws = $(window).scrollTop(); var onePage = $(window).height()/2; $(window).scroll(function() { var ws = $(window).scrollTop(); var top = $(".to_top"); ws > onePage ? 'ws>' + onePage + ',' + top.fadeIn().css("display", "block") : top.fadeOut(); }) var $top = parseInt($(window).scrollTop() / $(window).height()) + 1; $(".to_top").click(function() { $("html,body").animate({ scrollTop: 0 }, 260 * $top) }) if($w<=1023){ function stopPropagation(e) { var ev = e || window.event; if (ev.stopPropagation) { ev.stopPropagation(); } else if (window.event) { window.event.cancelBubble = true;//兼容IE } } $(".t_nav h3 b").click(function(){ $(this).parents("li").find(".sub_nav").slideToggle(); $(this).parents("li").toggleClass("on").siblings().removeClass('on').find(".sub_nav").slideUp(); }) $(document).bind('click', function () { $(".menu,.t_nav").removeClass('on'); $("html").removeClass("no_scroll"); $(".t_nav").slideUp() }); $('.menu').click(function (e) { $(this).toggleClass("on"); $("html").toggleClass("no_scroll"); $(".t_nav").slideToggle(); stopPropagation(e); }); $(".t_nav").click(function (e) { stopPropagation(e); }); $(".aside_tit").click(function(){ $(".nav_list").slideToggle(); $(this).toggleClass("on") }) } if($("div").is(".inset_bar")){ $("article").addClass("inset"); } if($("div").is(".nav_list")){ $(".nav_list .on").next(".sub_con").show(); $(".nav_list a b").click(function(){ $(this).parents("a").siblings().removeClass("on"); $(this).parents("a").next(".sub_con").siblings(".sub_con").hide(); $(this).parents("a").toggleClass("on").next(".sub_con").slideToggle(); return false }) } if(navigator.appName == "Microsoft Internet Explorer"&&parseInt(navigator.appVersion.split(";")[1].replace(/[ ]/g, "").replace("MSIE",""))<9){ $('body').append('

请升级浏览器版本

你正在使用旧版本浏览器。请升级浏览器以获得更好的体验。

') } $(".fontSize a").click(function(){ $(this).addClass("active").siblings().removeClass("active") }); $('input, textarea').placeholder(); }) function SetFont(size) { var w =$(window).width(); var e = window, a = 'inner'; if (!('innerWidth' in window )) { a = 'client'; e = document.documentElement || document.body; } var $w = e[ a+'Width']; if($w>=1299){ $(".news_bd *").css("font-size",size); }else if($w>=1299){ size=size-2; $(".news_bd *").css("font-size",size); }else{ size=size-2; $(".news_bd *").css("font-size",size); } }