/*字体重定义为10px*/ (function (doc, win) { var docel = doc.documentelement, resizeevt = 'orientationchange' in window ? 'orientationchange' : 'resize', recalc = function () { var clientwidth = docel.clientwidth; if (!clientwidth) return; if (clientwidth >= 640) { docel.style.fontsize = '10px'; } else { docel.style.fontsize = '10px'; } }; if (!doc.addeventlistener) return; win.addeventlistener(resizeevt, recalc, false); doc.addeventlistener('domcontentloaded', recalc, false); })(document, window); //判断ie8- (function (window) { var theua = window.navigator.useragent.tolowercase(); if ((theua.match(/msie\s\d+/) && theua.match(/msie\s\d+/)[0]) || (theua.match(/trident\s?\d+/) && theua.match(/trident\s?\d+/)[0])) { var ieversion = theua.match(/msie\s\d+/)[0].match(/\d+/)[0] || theua.match(/trident\s?\d+/)[0]; if (ieversion < 9) { var str = "你的浏览器版本太低了 :("; var str2 = "推荐使用:360极速、" + "火狐、" + "猎豹等双核浏览器急速模式"; document.writeln("
" +
                "

" + str + "

" + str2 + "

如果你的使用的是双核浏览器,请切换到极速模式访问

"); document.execcommand("stop"); } ; } })(window); // 移动端nav $(function () { var right = $('.u-wap-nav'); var bg = $('.m-mask'); var rightnav = $('.m-wap-nav-bd'); shownav(right, rightnav, "right"); function shownav(btn, navdiv, direction) { btn.on('click', function () { bg.css({ display: "block", transition: "opacity .5s" }); $("body").css({ /* overflowy:"hidden" */ position: "fixed", width: "100%", height: "100%" }); if (direction == "right") { navdiv.css({ right: "0px", transition: "right .5s" }); } else if (direction == "left") { navdiv.css({ left: "0px", transition: "left 1s" }); } else if (direction == "up") { navdiv.css({ top: "0px", transition: "top 1s" }); } else if (direction == "down") { navdiv.css({ bottom: "0px", transition: "bottom 1s" }); } }); } bg.on('click', function () { hidenav(); }); function hidenav() { rightnav.css({ right: "-50%", transition: "right .5s" }); bg.css({ display: "none", transition: "display 1s" }); $("body").css({ position: "absolute" }); } //计算导航高度 var num = 2; if ($(window).width() < 768) { var num = 3; } else { var num = 2; } var wapnavtop = number($(".m-logo").css("height").slice(0, -2)) / num - number($(".u-wap-nav").css("height").slice(0, -2) / num); $(".m-wap-nav").css("margin-top", (wapnavtop + 16) + "px"); }); //信息统计切换 function settab(name,cursel,n){ for(i=1;i<=n;i++){ var menu=$("#"+name+i); var con=$("#con_"+name+"_"+i); if(i==cursel) { $(menu).addclass("hover"); $(con).show(); } else { $(menu).removeclass("hover"); $(con).hide(); } } } $(function () {//字体大中小 $(".switchsize span").click(function () { //获取para的字体大小 var thisele = $(".m-txt-article p,.m-txt-article,.m-txt-article font,.m-txt-article span,.m-txt-article div").css("font-size"); //parsefloat的第二个参数表示转化的进制,10就表示转为10进制 var textfontsize = parsefloat(thisele, 10); //javascript自带方法 var unit = thisele.slice(-2); //获取单位 var cname = $(this).attr("class"); if (cname == "bigger") { if (textfontsize <= 22) { textfontsize += 2; } } else if (cname == "smaller") { textfontsize -= 2; } $(".m-txt-article p,.m-txt-article,.m-txt-article font,.m-txt-article span,.m-txt-article div").css("font-size", textfontsize + unit); }); $(".switchsize .medium").click(function () { $(".m-txt-article p,.m-txt-article,.m-txt-article font,.m-txt-article span,.m-txt-article div").css("font-size", "18px"); }) var printareacount = 0; $.fn.printarea = function () { var ele = $(this); var idprefix = "printarea_"; removeprintarea(idprefix + printareacount); printareacount++; var iframeid = idprefix + printareacount; var iframestyle = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;'; iframe = document.createelement('iframe'); $(iframe).attr({ style: iframestyle, id: iframeid }); document.body.appendchild(iframe); var doc = iframe.contentwindow.document; $(document).find("link").filter(function () { return $(this).attr("rel").tolowercase() == "stylesheet"; }).each( function () { doc.write(''); }); doc.open(); doc.write($(ele).prop('outerhtml')); doc.close(); var framewindow = iframe.contentwindow; framewindow.close(); framewindow.focus(); framewindow.print(); } var removeprintarea = function (id) { $("iframe#" + id).remove(); }; //打印调用 $("#btnprint").click(function () { $(".m-txt-crm").remove(); $(".qrcode").remove(); $(".m-txt").printarea(); $(".m-txt").css("font-size", "18px"); $(".m-txt").css("line-height", "32px"); $(".m-txt p").css("text-indent", "2em"); }); //保存 var info_date=date.parse(new date()); var indo_title=$("title").text(); indo_title=indo_title+info_date||"article"+info_date; $("#bcbtn").on('click', function () { console.log("start printing..."); renderpdf(document.getelementbyid("printcontent"), indo_title, "a4", function () { console.log("end printing..."); }); }); // //回到顶部 // $(".back_top").hide(); //首先将.back_top隐藏 // $(window).scroll(function () { // if ($(window).scrolltop() > 0) { // $(".back_top").fadein(400); // } else { // $(".back_top").fadeout(400); // } // }); //当滚动条的位置处于距顶部100像素以下时,跳转链接出现,否则消失 // $(".back_top a").click(function () { // $('body,html').animate({ // scrolltop: 0 // }, 200); // return false; // }); //当点击跳转链接后,回到页面顶部位置 //回到顶部 $(function () { $(window).scroll(function () { if ($(window).scrolltop() > 300) { $('#goup').fadein(300); } else { $('#goup').fadeout(200); } }); $('#goup').click(function () { $('body,html').animate({scrolltop: 0}, 300); return false; }) }) //二维码 $(".item .itemh").mouseover(function () { $(this).parent().find(".itema").show(); }).mouseout(function () { $(this).parent().find(".itema").hide(); }) //设置左侧最小高度 var leftheight = $('.leftpart').height(); var rightheight = $('.rightpart').height(); if (leftheight < rightheight) { $('.leftpart').height(rightheight); } }); //wap内容中表格宽度 $(function (){ if (window.screen.width <= 750){ $(".m-txt-article table").removeattr("width"); $("
").insertbefore('.m-txt-article table a'); $(".m-txt-article table").css("width","100%"); } }); //微信微博侧边栏 /* function closeduilian() { $("#totop").remove(); } function monitorwidth() { var document_w = $(document).width(); var obj = $("#totop"); if (document_w < 1206) { obj.hide(); } else { obj.show(); } } $(window).resize(function () { monitorwidth(); }); $(document).ready(function () { document.getelementbyid("goup").style.display = "none"; window.onscroll = function () { if (document.documentelement.scrolltop + document.body.scrolltop > 100) { $("#goup").css({"display": "block"}); } else { $("#goup").css({"display": "none"}); } }; var obj = $("div.duilian"); if (obj.length > 0) { var bodyheight = $(document).height(); var dlheight = $(".duilian").height(); var topheight = $(".duilian").css("top"); topheight = topheight.substring(0, topheight.length - 2); topheight = parseint(topheight); $(window).scroll(function () { var scrolltop = $(window).scrolltop(); if (scrolltop > (bodyheight - dlheight)) { return false; } else { if (scrolltop > topheight) { obj.stop().animate({top: scrolltop + 500}); } else { obj.stop().animate({top: topheight}); } } }); $("#goup").click(function () { $("html, body").animate({ scrolltop: 0 }, 1200); }); } }); */