Quote:
Originally Posted by Amzul
- function Find(x){
-
//alert(document.getElementById(x).style.position);
-
pos = document.getElementById(x).style.position;
-
document.getElementById(x).style.position = pos + 150;
-
}
what am i doing wornge here :\
thanks
I think you mixed position with (say) left. values for element.style.position are: absolute, relative, static, fixed. you probably meant element.style.left. and you forgot the 'px'.
note: Trying myself (FF 3.01/Mac OS 10.4.11) I had no problems setting the element's style this way, but I could get the settings only through:
- var elem = document.getElementById("_elem_id_");
-
var cs = window.getComputedStyle(elem, null);
-
var val = cs.left; // only works for absolute values (i.e. no em, ex, %)
dunno how it is with IE
FF/Opera can also use the methods getPropertyValue() / getPropertyCSSValue() (DOM level 2 - style)
regards