javascript - rails rjs modify style in the body to add margin -


How do I use RJS to modify css elements on a page? I "divin-top: 2.8em;"

How can I get it with RJS or should I do something like this

  page & lt; & Lt; ". Document.getElementById ('Super Rap') style.margin top = '2.8em;';"  

However this does not work.

Thanks

found this:

  # Some.html.erb Page. Call "set_style", "super-rap", "some css-class" #css .some_css_class {margin-top: 2.8 them; } # Appliction.js function set_style (element, class_name) {new element. Classname (element) .set (class_name); }  

Now I need to reduce it ... At the moment it just dumps itself.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -