I''m reading in, the only RoR book I could find in the local bookstore,
_Agile Web Development with Rails_. In the Web 2.0 section they talk about
using DOM manipulating JavaScript commands like "Element.Toggle(element,
...)". I like how those work, but want to execute multiple commands on one
event.
I want to be able to do a:
$(''some_id'').style.display=''none''
then a
$(''another_id'').style.display=''inline''
both on a "onclick" event:
<div id="shade"
onclick="$(''shade'').style.display=''none''">
any help would be appreciated.
Thanks,
Couple ways you could do it...
#1
Make a javascript function....
function clickme(id1, id2) {
$(''id2'').style.display=''none'';
$(''id3'').style.display=''inline''; }
then call the function in the onclick attribute...
<div id="shade" onclick="clickme(''shade'',
''something_else'');">
#2
you can put 2 lines on the onclick attribute (semi-colon separated lines)
<div id="shade"
onclick="$(''shade'').style.display=''none'';$(''something_else'').style.display=''inline'';">
Hope that helps,
Mark
--
Mark Van Holstyn
mvette13-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
http://lotswholetime.com
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails