I am writing a jquery plugin that changes the css value of certain elements to specific user actions. For other actions, the css value should be reset to their initial value.
Since I did not find a way to return the initial values of css, I just created an array in which all the initial values are stored at the beginning.
I did it with
var initialCSSValue = new Array()
pretty at the beginning of my plugin, and then, in some setup loop, where all my elements access, I used
initialCSSValue[$(this)] = parseInt($(this).css('<CSS-attribute>'));
This works very well in Firefox. However, I only found out that IE (even v8) again has problems accessing a specific value using
initialCSSValue[$(this)]
somewhere else in the code. I think this is due to the fact that I use the object ($ (this)) as the name of the variable.
?