Forum: Ruby on Rails AJAX Visual effect Loading

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Alex Peretti (Guest)
on 2006-01-19 03:33
Hi people, I made a portfolio gallery on my site
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 => "'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

<div id="imagediv_bg">

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

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


This topic is locked and can not be replied to.