⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 read_modify_existing_style_sheet.js

📁 《JavaScript精粹》 源文件下载
💻 JS
字号:
addLoadListener(init);

function init()
{
  if (typeof document.styleSheets != "undefined")
  {
    var printStyleSheet = document.styleSheets[1];
    var printRules = null;

    if (typeof printStyleSheet.rules != "undefined")
    {
      printRules = printStyleSheet.rules;
    }
    else
    {
      printRules = printStyleSheet.cssRules;
    }

    printRules[1].style.textDecoration = "overline";
  }
}

function addLoadListener(fn)
{
  if (typeof window.addEventListener != 'undefined')
  {
    window.addEventListener('load', fn, false);
  }
  else if (typeof document.addEventListener != 'undefined')
  {
    document.addEventListener('load', fn, false);
  }
  else if (typeof window.attachEvent != 'undefined')
  {
    window.attachEvent('onload', fn);
  }
  else
  {
    var oldfn = window.onload;
    if (typeof window.onload != 'function')
    {
      window.onload = fn;
    }
    else
    {
      window.onload = function()
      {
        oldfn();
        fn();
      };
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -