rubyonrailsin

A Ruby and Rails talk

Thursday, March 11, 2010


[Rails] Re: How to hide an object???

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

Robert Walker wrote:
> Guille San wrote:
>> <script type="text/javascript">
>>
>> function lastSpy() {
>>
>> var target = $('imagen');
>>
>> if (!target) return false;
>> new Ajax.PeriodicalUpdater(target,
>> 'http://localhost:3000/',{frequency:'1'})
>>
>> }
>> Event.observe(window, 'load', lastSpy, false);
>> document.observe("dom:loaded", function() {
>>
>> $$('imagen').invoke('hide');
>
> I assume what you want is to find the element with id='imagen' and hide
> it. That would be:
>
> $('imagen').hide();
>
>> });
>>
>> </script>
>> <div id="imagen" >
>> <%=image_tag("/guarrada/Debug/foto.jpg") %>
>> </div>

I also just noticed that once you get the hide() working, you have
nothing in your script to show it again. You are trying to make an AJAX
call to update it's contents every second, but the element would still
be hidden. Is that what you intended?
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive