请问:currentStyle的用法。 currentStyle怎么使用啊?希望给个小例子解释一下。还有就是getComputedStyle又是什么意思啊?这两个对象,所有的浏览器都支持吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 呵...好象和我的问题一样.参考..http://topic.csdn.net/u/20090727/16/62c35b78-5b53-4e1b-90af-8d1e1726ed86.html?38936 currentStyle 是IE仅有的 --only IEgetComputedStyle 用来获得元素的最终样式(包括在外部定义的样式) 借这个发一个问题,currentStyle是不是只读的? currentStyle 用于取控件样式,可以取 style 定义的,也可以取 <style></style> 定义的<style>div{width:200px;height:100px;}</style><div id="div1" style="border:1px solid black;"></div><div id="divmsg"></div><script>window.onload = function(){ var obj = document.getElementById("div1"); var crtstyle = obj.currentStyle || obj.ownerDocument.defaultView.getComputedStyle(obj, null);// 前者用于IE,后者FF var str = ""; for(var e in crtstyle){ str += e + " === " + crtstyle[e] + "<br/><br/>"; } document.getElementById("divmsg").innerHTML = str;}</script> http://www.phpx.com/man/dhtmlcn/objects/currentStyle.htmlcurrentStyle是只读的 getComputedStyle应是除IE外都支持的 谢谢各位了,getComputedStyle具体有哪些参数啊?? style,currentStyle,runtimeStyle,getComputedStyle的区别及用法http://hedgehogking.com/?p=169 JS 在线投票功能 JS截取字符串的问题 这样实现那里出问题?? 有关定时器setTimeOut&clearTimeOut 几道Javascript面试题目,高手来答。。。 打算用javascrip做个万年历的页面,有人做过么 在html页面上调用浏览器的 页面设置、打印、打印预览 功能 如何在静态文件htm中包含一个动态网页jsp? 请问:如何让一个打开的页面刷新一次,设置时间循环刷新的办法不用考虑,我需要能够主动控制,谢谢! 取url中?后参数的javascript函数是什么? 怎么用jquery实现这个点击隐藏和显示呢? 在QQ注册页面抓的JS,这段看不懂什么意思,求JS高手
参考..http://topic.csdn.net/u/20090727/16/62c35b78-5b53-4e1b-90af-8d1e1726ed86.html?38936
<style>
div{
width:200px;
height:100px;
}
</style>
<div id="div1" style="border:1px solid black;"></div>
<div id="divmsg"></div>
<script>
window.onload = function(){
var obj = document.getElementById("div1");
var crtstyle = obj.currentStyle || obj.ownerDocument.defaultView.getComputedStyle(obj, null);// 前者用于IE,后者FF
var str = "";
for(var e in crtstyle){
str += e + " === " + crtstyle[e] + "<br/><br/>";
}
document.getElementById("divmsg").innerHTML = str;
}
</script>
http://hedgehogking.com/?p=169