I would like to know how to go about showing a spinner while a heavy weight image loads (AJAX style). This spinner will appear in the window until the image is fully loaded (something similar to what flickr does ). Anyone has any pointer for me in this direction. Any open source code which implements something like this? Thanks. -=- Neeraj _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi, 2005/10/20, Neeraj Kumar <neeraj.jsr@gmail.com>:> I would like to know how to go about showing a spinner while a heavy weight > image loads (AJAX style). This spinner will appear in the window until the > image is fully loaded (something similar to what flickr does ). Anyone has > any pointer for me in this direction. Any open source code which implements > something like this?Create an animated GIF. Load the GIF, but set it's style property to display:none. When :loading, set display:block. When :complete, set display:none again. Something like this (view code): <div id="big_image"> <%= image_tag('spinner.gif', :style => 'display:none', :id => 'spinner') %> </div> <%= remote_function(:update => 'big_image', :loading => "$('spinner').style.display = 'block';", :complete => "$('spinner').style.display = 'none';" %> WARNING: Untested code Hope that helps ! François _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Oct 20, 2005, at 7:13 PM, Neeraj Kumar wrote:> I would like to know how to go about showing a spinner while a > heavy weight image loads (AJAX style). This spinner will appear in > the window until the image is fully loaded (something similar to > what flickr does ). Anyone has any pointer for me in this > direction. Any open source code which implements something like this?Is lowsrc still a valid attribute for the img element? I haven''t tested this but you might want to see what browsers support it: <img src="some_big_image.bmp" lowsrc="spinner.gif" /> George -- George Hotelling GPG: 0x8175D485 ] http://george.hotelling.net ] _ _ _ ___ _ _ _/ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails