Guille San wrote:
> Hi
> I only have one question more. How can I do this example with prototype:
>
> Example in jQuery
> -------------------
> $(document).ready(function() {
> $('#my_element').hide();
> });
I wish Prototype had this built-in. However, it's pretty easy to add the
onDOMReady extension script and then use the following:
Event.onDOMReady(function() {
$('my_element').hide();
});
You can find that extension script here:
http://smoothoperatah.com/files/onDOMReady.js
Otherwise, you can also just wait for the whole page to load with
something like:
Event.observe(window, "load", function() {
$('my_element').hide();
});
I prefer using the onDOMReady extension because it's designed to wait
only for the DOM itself to load and not the entire page, and does so
with cross browser support.
--
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.