I’m trying to manipulate a div element. Although I have defined certain property values, I can’t seem to get the initial values.
Here’s the problem: Fiddle
I’m at the end of my rope… Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you have to use
document.styleSheets, find your stylesheet, then loop through the cssRules(IE rules) list to match a selector to"#viewbase"and then you can access your style properties like you would have with inline styles, since the style info in there is also a CSSStyleDeclaration ( so you can use element.style.left and so on).Sidenode:
getComputedStyledoesn’t work on most versions of IE. IE hascurrentStyleproperties for each element, but it’s not the same thing. Maybe a combination of both will also work.UPDATE
Managed to get the initial positions, if that’s what you need, you can reassign these values if i remember well.
The other version would be to use the following