I’m trying to string together a few visual effects and having a ton of
trouble making it work. I’ve searched this forum and read the couple of
threads dealing with this but I’m not having much luck with solutions
presented there. Essentially, I want to fade an image, replace it with a
new image, then appear it back. But in the interests of simplifying the
problem, let’s just say I want to fade an image and then appear it back
(gradually, using the appear effect).
So, I have this in a view:
and in my controller I have this:
def change_image1
render :update do |page|
page.visual_effect(:fade, “testimage1”, {:queue => “front”})
end
end
def change_image2
render :update do |page|
page.visual_effect(:fade, “testimage2”, {:queue => “front”})
page.visual_effect(:appear, “testimage1”, {:queue => “end”})
end
end
And it works fine - click the first link and the first image fades;
click the second link and the second image fades, then the first image
appears, in order.
However, if I try to fade and appear the same image, with something like
this in the controller:
def change_image2
render :update do |page|
page.visual_effect(:fade, “testimage2”, {:queue => “front”})
page.visual_effect(:appear, “testimage2”, {:queue => “end”})
end
end
It does not work. The image fades, then just comes back in a blink
without the appear effect showing.
I see some stuff out there about :beforeStart and whatnot but can’t seem
to find any syntax for laying that out that works to solve the problem.
I’ve also gone over and over
http://blog.railsdevelopment.com/pages/effect/queue/ and can’t find an
answer there either.
I would appreciate any help or links/pointers to some help.
c.