当前位置: 代码迷 >> JavaScript >> Style与currentStyle,该怎么解决
  详细解决方案

Style与currentStyle,该怎么解决

热度:234   发布时间:2012-04-19 14:36:43.0
Style与currentStyle
调用css外部样式表

JScript code
var p=document.getElementById('pic');
var left=p.currentStyle.left;
left=parseInt(left.substr(0,left.length-2));
p.style.left=(left+10)+"px";//这里为什么是style才能移动,而改成currentStyle就无法移动?



------解决方案--------------------
currentStyle只用来取值。
------解决方案--------------------
貌似就是只取值,不赋值
------解决方案--------------------
属必有 get set 两种动作
有的只有get 没有set
------解决方案--------------------
http://www.phpx.com/man/dhtmlcn/objects/currentStyle.html
  相关解决方案