MooTools Window Object 清单
MooTools Window Object 清单
你想看到网页浏览器window 的 property吗?也许接下来的操作,可以得到你想要的结果。
演示:Demo
模拟一个控制台:
The HTML
1 2 | <h2>Window Properies</h2> <div id="console"></div> |
The CSS
1 2 3 4 5 6 7 8 9 10 11 12 13 | #console pre{ font-family:Courier; font-size:11px; background:#000; color:lightgreen; margin:0 0 20px 0; padding:10px; overflow: scroll; } #console h3{ color:navy; padding:3px 0; } |
The MooTools JavaScript
1 2 3 4 5 6 | window.addEvent('domready',function() { new Hash(window).each(function(value,property) { new Element('h3',{ text: property }).inject($('console')); new Element('pre',{ text: value }).inject($('console')); }); }); |
根据您所加载到页面中一个JavaScript框架,在不同的浏览器中得到的窗口对象(window object)会有所不同。
文章评论 已经有 0 条评论!