Guille San wrote:
> Hi everyone:
> I want to hide an object before it load. I see in the API the function
> page.hide but I don“t have any idea about how to use it properly. Anyone
> can help me?? Is there any other form to do that??
By "object" I assume you mean "HTML element."
<div id='my_element'>
This should get hidden
</div>
Prototype
-------------------
$('my_element').hide();
-------------------
jQuery
-------------------
$('#my_element').hide();
-------------------
RJS
-------------------
page['#my_element'].hide
-------------------
In any of these cases you also need to wait for the DOM to fully load
before attempting to hide the element:
Example in jQuery
-------------------
$(document).ready(function() {
$('#my_element').hide();
});
-------------------
Or, in case you want the element initially hidden, then use JavaScript
to show it later.
<div id='my_element' style='display: none;'>
This should get shown later
</div>
jQuery
-------------------
$('#my_element').show();
-------------------
--
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.