rails rjs modify style in the body to add margin

Posted by holden on Stack Overflow See other posts from Stack Overflow or by holden
Published on 2009-10-17T11:19:49Z Indexed on 2010/03/29 9:03 UTC
Read the original article Hit count: 538

Filed under:
|
|
|
|

How can I use RJS to modify CSS elements on a page? I'm looking to do modify the margin of a div to add a "margin-top: 2.8em;"

How can I access this with RJS or should i use something like

page << "document.getElementById('super-wrap').style.margin-top='2.8em;';"

Though this doesn't work.

Thanks

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about rjs