I''m pretty new to javascript, and scriptaculous, but I know what I want to do. I want to make it so that when a person clicks a link, the previous content of the div fades out, and the new content fades in. This is what I''ve got for my function: <script type="text/javascript"> //<![CDATA[ function loadmerch(im) { new Element.Fade(''full-merch''); Element.hide(''full-merch''); new Effect.Appear(''full-merch''); ajaxpage(''merchpic.php?im=''+im, ''full-merch''); } //]]> </script> Then when the use clicks the link: <a onclick="loadmerch(''ep.jpg'');" href="#"> it will fade out previous content (if any), and fade in the new content. But when I click the link, nothing happens. It works if I remove new Element.Fade(''full-merch'');, but then the previous content just disappears. Please help. Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey there, PAOEGONVG a écrit :> I''m pretty new to javascript, and scriptaculous, but I know what I want > to do. > I want to make it so that when a person clicks a link, the previous > content of the div fades out, and the new content fades in.Your issue is due to parallel execution. You need per-link effect queues. You''ll find a code very similar to your needs (it handles mouseover and mouseouts much the same way you want to handle your clicks) here: http://tddsworld.com/extrahost/rails-spinoffs/hoverfades.html Regards, -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Maybe Matching Threads
- 3 prototype/scriptaculous effects in order on one <div>
- Swat lets everybody into the "good stuff"
- Problem running stepAIC within a function.
- Paginate - Count(*) Broken or Am I Cheating?
- Regular audio fade-out fade-in on IAX2 calls Asterisk 1.2.4 Hi all, One of my users has a problem with many of his calls via my Asterisk™ server. He describes the problem as having the sound slowly fade out and then fade back at a regular frequency. Has