很奇怪,见到 ctrl + - 不能控制的页面,找了一下原因,没找到。做个 bookmarklet,修改中,目前不能对老式的 table 布局页面处理…
如果是 12px 的字体,IE不能控制大小,IE 下使用说明在此
某些页面在 firefox 下也不通过 ctrl+- 或者 ctrl+鼠标滚轮 来控制字体大小,firefox 下使用说明在此
源代码如下:
javascript:javascript:if(document.body.currentStyle){oSize=document.body.currentStyle.fontSize;oUnit=oSize.replace(/d/g,”");oNum=parseInt(oSize.replace(/D/g,”"))+1;oStyle=”font-size:”+oNum+oUnit;void(document.body.style.cssText=oStyle);}if(document.defaultView){oSize=document.defaultView.getComputedStyle(document.body,null).getPropertyValue(’font-size’);oNum=parseInt(oSize.replace(/D/g,”"))+1;oStyle=”font-size:”+oNum+”px”;void(document.body.style.cssText=oStyle);}
下面是 styleSheets 对象测试
javascript:if(document.styleSheets[0].insertRule){void(document.styleSheets[0].insertRule(”* {font-size:60px !important}”,0))}if(document.styleSheets[0].addRule){void(document.styleSheets[0].addRule(”*”,”{font-size:60px !important}”,0))}
Leave a reply