Hi all,
I''m building a simple slideshow using prototype and scriptaculous, you
can see it in action here: http://www.cuboestudioweb.com/projects/tickerbox/.
It''s working great in firefox and IE7, but in IE6 has a problem to
verify when the images has finished loading.
The loading is checked like this:
var loaded = Array();
var countPhotos = 0;
initialize = function(){
photos = $$(''#tickerbox .ticker'');
countPhotos = photos.length;
hideAllPhotos();
}
hideAllPhotos: function() {
for(i=0;i<photos.length;i++){
photos[i].hide();
Event.observe(photos[i],''load'',function(){
loaded.push(''loaded'');
if(loaded.length == countPhotos){
Element.hide(''ticker-loading'');
start();
}
});
photos[i].style.height = containerHeight+''px'';
}
}
Event.observe(document,"dom:loaded", initialize);
I''ve modified the original script to show only the loading piece. The
original could be found in the address above.
What I''m doing here is getting the imageset lenght, hidding all the
images and adding a load function event to each image. That event
checks the loaded array lenght to see if equals the total number of
images. If true the slideshow starts.
Apparently in IE6 that count doesn''t happen every time. I did a few
alerts to see if the load function was called, but didn''t find
anything to solve that problem.
Am I doing something wrong? Can you guys see a better way to do that?
I don''t write much in english, so if you can''t understand very
well
please say something.
--
Alexandre Marinho - BRAZIL
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---