D
dhtml
David said:Interesting. Whey not just save the inline padding style?
Shorthand values don't always return the value you gave it.
<div style="padding: 10px 0">
</div>
var s = div.style.padding;
Variable - s - might be empty string in some browsers. It is in Safari
2. So, if it were saved and then put back, you'd end up removing padding.
A similar problem occurs with getComputedStyle(el,'').padding. Most
browsers return empty string instead of a shorthand value.
Feature test with a side effect.
Garrett