As I understand it: get and set style are not symmetrical because of CSS
cascaded inheritance:
"get" will return the cascaded style which starts with the HTML element
property, may be overridden by the CSS directive, which may
be overridden by coding style="whatever" in the HTML. getStyle will return
whichever property cascaded down to dominate. It would
be difficult to determine in JavaScript where the style declaration came from,
but if it were known, it might solve the upcoming
problem.
OK, we've got the style but we don't know from whence it came. Now after
overwriting the element "style" doing an effect, we would
like to "set" things back. There's the problem...
Without the ability to undo the setStyle, using setStyle( {display: ''} ) is a
partial solution.
Each of these 3 divs will end up with different results when an effect
"restores" the display style state using setStyle( {display:
''} )
<div style="display:none">abc</div>
<div style="display:block">abc</div>
<div style="display:inline">abc</div>
Wouldn't it be possible to save the original style in a stack so the element
style could be restored to it's original state?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---