Forum: Ruby on Rails AJAX Visual effect Loading

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ddd318eb14b80b5b048a4adc1901e68e?d=identicon&s=25 Alex Peretti (Guest)
on 2006-01-19 02:33
Hi people, I made a portfolio gallery on my site
www.pulsedev.net/portfolio
I'm happy with it except for the fact that I setup a loading gif but the
new page starts to load before its ready, so the image inside the page
loads in front of the users eyes.

I would really appreciate some help on this.

The way I have set it up is by using a link_to_remote function like so

	<%= link_to_remote(image_tag("clubice_tb.jpg"),
					{:update => 'imagediv',
					:url => { :action => :clubice_window },
					:loading => "Element.show('search-indicator')",
					:complete => "Element.hide('search-indicator'), new
Effect.toggle('imagediv', 'blind')"},
					{ :href => "../images/clubice.jpg" })
					%>

And the action :clubice_window is a view which contains this code

<center>
<div id="imagediv_bg">

<% cache do %>
<%= image_tag("clubice.jpg")%>
<% end %>
<br />
<%= link_to_function "Close window", "new Effect.toggle('imagediv',
'slide')"%>
</div>
</center>

It would be great if anybody could point out anything obviously wrong
with this.

Regards,

Alex
This topic is locked and can not be replied to.