$(function () { //调整字体大小 $(".fontsize i").click(function(){ var thisEle = $("#zoomcon").css("font-size"); //parseFloat的第二个参数表示转化的进制,10就表示转为10进制 var textFontSize = parseFloat(thisEle , 10); var unit = thisEle.slice(-2); //获取单位 var cName = $(this).attr("class"); if(cName == "l" && textFontSize <30){ textFontSize += 2; }else if(cName == "s" && textFontSize >12){ textFontSize -= 2; }else if(cName == "m"){ textFontSize = 16; } //设置para的字体大小 $("#zoomcon").css("font-size", textFontSize + unit ); $("#zoomcon").find("*").css("font-size", textFontSize + unit ); }); $(".ishare").click(function(e){ $(".article-share").toggleClass("article-share-opened"); $("#shareNode").toggleClass("shareNode-m"); e.stopPropagation(); }); $("#shareNode").click(function(e){ e.stopPropagation(); }); $(document).click(function(){ $(".article-share").removeClass("article-share-opened"); $("#shareNode").removeClass("shareNode-m"); }); $("#shareNode .btn").click(function(){ $(".article-share").removeClass("article-share-opened"); $("#shareNode").removeClass("shareNode-m"); }); if($(".article-appendixs ul li").length > 0){ $(".article-appendixs").fadeIn('fast'); } if($(".article-reldocuments ul li").length > 0){ $(".article-reldocuments").fadeIn('fast'); } if($.trim($(".article-attr .ly b").text()) == ""){ $(".article-attr .ly b").text(websiteName); } //打印关闭按钮鼠标经过效果 $(".article-button").find("a").hover(function(){ $(this).addClass("hover").siblings().removeClass("hover"); }); /*浏览量*/ var id=window.location.href.split('/').pop().split('.')[0]; function dj(){ $.ajax({ url:'http://apps.ganzhou.gov.cn/szfwlwzweb/doc/getClicks', type:'post', dataType: "jsonp", data:{'id':id}, contentType : "application/x-www-form-urlencoded; charset=UTF-8", success:function(param){ //点击数 var count = param.count; //$('#view').html(count); } }); } dj(); /*文章关键字标签转换*/ function tagTranslate(){ var cmsproTags = $("#cmsproTags").val(); if(cmsproTags!=null&&cmsproTags!=''){ var tags = cmsproTags.split(","); var tagsString = ""; if(tags!=null){ for(var i = 0 ; i < tags.length-1 ; i++ ) { // tagsString += "" + tags[i] +" "; tagsString += "" + tags[i] +" "; // tagsString += "" + tags[i] +""; } } $("#showTags").html(tagsString); } } /* function searchByTagName(tagName){ var searchUrl = "/" + webSiteCode + "kjj/wzss/search.shtml?keywords=" + encodeURI(tagName) ; window.open(searchUrl); } */ /*调用文章关键字标签转换*/ tagTranslate(); // 分享 $("#content-share").append('
') window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "24" }, "share": {} }; with(document) 0[body.appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion=' + ~(-new Date() / 36e5)]; }); //mp4格式视频兼容方法: function convertMedia(){ if (!document.getElementById("zoomcon")) return ; var mediaDom = document.getElementById("zoomcon").getElementsByTagName("embed") ; var videoDom = document.createElement("video") ; if (typeof(videoDom.canPlayType) != "undefined" && mediaDom && mediaDom.length > 0){ for(var i = 0 ; i < mediaDom.length ; i++) { var el = mediaDom[i] ; var newMediaDom = document.createElement("video") ; newMediaDom.setAttribute("controls" , "controls") ; newMediaDom.setAttribute("preload" , "preload") ; newMediaDom.setAttribute("src" , el.getAttribute("flashvars").replace(/^vcastr_file=/ , "")) ; newMediaDom.setAttribute("width" , "60%") ; // el.width newMediaDom.setAttribute("height" , "auto") ; // el.height var parentDom = el.parentNode ; el.style.display="none" ; parentDom.appendChild(newMediaDom) ; //parentDom.removeChild(el) ; } var len = mediaDom.length ; for(var i = 1 ; mediaDom.length > 0 ; i++ ) { var parentDom = mediaDom[0].parentNode ; parentDom.removeChild(mediaDom[0]) ; if (i >= len){ break ; } } } } convertMedia() ;