Chase Midler wrote:
> I want to know how I can have my html text not display when a page
> loads, but still works with toggle. I.E. when using the css
> display:none; toggle does not work, but the html is hidden. When I do
> not use the css display:none; toggle does work, but the html is always
> present when I first load the page.
Make sure you are loading prototype js libraries for this page --
<%= javascript_include_tag :defaults %>
this example assumes you view has an image which when clicked displays a
hidden content and hides it when click again.
view
-----
<%= image_tag("blah", :onclick=>"$('abc').toggle();")%>
<div id="abc" >
...hidden content...
</div>
css
----
#abc {
display:none;
}
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---