doughamlin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-16 21:50 UTC
accessible Effect.Appear in scriptaculous
I''m trying to use Effect.Appear to fade in posts on a photoblog. The wiki entry for Effect.Appear says it will work "if the element was previously set to display:none; inside the style attribute of the element." Unfortunately, that method will leave the image hidden if JS is disabled. I thought I could work around this by using JS to first set display:none and then fade in, like this: function fadeIn() { var current = document.getElementById("main"); current.style.display="none"; new Effect.Appear(current, { duration: 2.0 } ); } window.onload = fadeIn; But that method ends up flashing the image before hiding it and then fading in. Is there some way I can make this accessible, and not have the image flash on load? Page is here: http://throughalensdarkly.com/ Thanks, Doug --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Probably the best idea is to implement some version of the DOMContentLoaded event. http://dean.edwards.name/weblog/2006/06/again/ Alternately, you could use a combination document.write/noscript solution (bleh!). TAG On May 16, 2007, at 3:50 PM, doughamlin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > I''m trying to use Effect.Appear to fade in posts on a photoblog. The > wiki entry for Effect.Appear says it will work "if the element was > previously set to display:none; inside the style attribute of the > element." Unfortunately, that method will leave the image hidden if JS > is disabled. > > > I thought I could work around this by using JS to first set > display:none and then fade in, like this: > function fadeIn() { > var current = document.getElementById("main"); > current.style.display="none"; > new Effect.Appear(current, { duration: 2.0 } ); > } > window.onload = fadeIn; > > > But that method ends up flashing the image before hiding it and then > fading in. Is there some way I can make this accessible, and not have > the image flash on load? Page is here: http://throughalensdarkly.com/ > > Thanks, > Doug > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---