1. 程式人生 > >js頁面設定與列印(頁首頁尾,頁邊距設定)

js頁面設定與列印(頁首頁尾,頁邊距設定)

//獲得IE瀏覽器版本
        function checkIEV() {
            var X, V, N;
            V = navigator.appVersion;
            N = navigator.appName;
            if (N == "Microsoft Internet Explorer")
                X = parseFloat(V.substring(V.indexOf("MSIE") + 5, V.lastIndexOf("Windows")));
            else
                X = parseFloat(V);
            return 
X;
        }
        //設定為不列印
        function noPrint() {
            var stylef = document.styleSheets[0];
            var rul = stylef.rules[0]; /*上面@media 那一段*/
            rul.style.display = "none";
        }