www.gusucode.com > YulinCMS 雨林内容管理系统 2.0源码程序 > Common/JS/Print.js

    
/************************ 内容页打印JS脚本 **********************/

 
 // 是否打印图片
 function printImg(obj)
 {
     if(obj.checked)
     {
		 document.getElementById("printContent").className = "";
	 }
	 else
	 {
	     document.getElementById("printContent").className = "NoImg";
	 }
}
    
// 改变字体大小
 function changeFont(size)
 {
    document.getElementById('printContent').style.fontSize = size + "px";
    var printContentChilds = document.getElementById('printContent').childNodes;
	for(var i = 0; i < printContentChilds.length; i++)
	{
	    if(printContentChilds[i].nodeType == 1)
	    {
	        printContentChilds[i].style.fontSize = size + "px";
	        //printContentChilds[i].style.lineHeight = size + size + "px";
	    }
	}
}
 
// 改变字体按钮样式
function changeFontBtn(n)
{
    for(var i=0;i<4;i++)
    {
        document.getElementById("topFontBtn_"+i).className = "unSelectedFont";
        document.getElementById("bottomFontBtn_"+i).className = "unSelectedFont";    
    }
    document.getElementById("topFontBtn_"+n).className = "selectedFont";
    document.getElementById("bottomFontBtn_"+n).className = "selectedFont";
}