AJAX Visual effect Loading

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

<% cache do %>
<%= image_tag(“clubice.jpg”)%>
<% end %>


<%= link_to_function “Close window”, “new Effect.toggle(‘imagediv’,
‘slide’)”%>

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

Regards,

Alex

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs