摘要: function BIdName(sname){ return document.getElementById(sname).style;}function BClassName(sname){ for (var i=0;i<document.styleSheets.length;i++) { var rules; if (document.styleSheets[i].cssRules) { rules = document.styleSheets[i].cssRules; } else { ru... 阅读全文
posted @ 2013-03-19 13:28 banbu 阅读(2218) 评论(0) 推荐(0) 编辑
摘要: ie不支持getElementsByClassName,所以要自己实现获取类名为className的所有元素。 1 <html> 2 <head> 3 <script type="text/javascript"> 4 5 window.onload = function() 6 { var topMenus = getClass('li','topMenu'); 7 for(var i=0;i < topMenus.length; i++) 8 { 9 alert(topMenus[i].inner 阅读全文
posted @ 2013-03-19 12:46 banbu 阅读(24090) 评论(1) 推荐(2) 编辑