Forum: Ruby on Rails Ajax question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4e1e96c1731488ca82f1e0a83a74ecd0?d=identicon&s=25 Fred (Guest)
on 2007-01-27 23:18
(Received via mailing list)
Hi everyone,

I've been trying to do somethign which I taught would be simple, but
it deosn't quite work.  Here goes:

When I display users, I have a prev/next link_remote_tag to quickly
goto the next or previous user.  What I'd like to do, is that when I
click on either of those links, the whole 'user' div does a blind_up,
and when the new user is loaded it appear with a blind_down effect.
To really show that the user displayed has changed.

I tried like this:

<%= link_to_remote "Prev",
                   { :update => "user_content",
                     :url => { :action => "prev" },
                     :complete => visual_effect(:blind_down,
'user_content'),
                     :loading => visual_effect(:blind_up,
'user_content')} %>

But it doesn't work...it just sort of flickers and then disappears...
(I also tried with the :before tag, but I had the same results).  Just
the :complete alone works...but it only does half the job.

Anyone knows how to make this work?

Thanks,

Fred

P.S.  Also would it be possible to make the user div (user_content) do
a blind_left/blind_right type of action?  To give the impression to
the person that the data is actually moving in front of him type thing.
39b36b2be47228f8619d61ea7a607a25?d=identicon&s=25 Matthew Beale (mixonic)
on 2007-01-28 17:14
(Received via mailing list)
On Sat, 2007-01-27 at 14:18 -0800, Fred wrote:
>
It's not the prettiest solution, but you can put both effects on the
same trigger (like complete), and then specify a length for the first
and delay for the second.  Scriptaculous/prototype arn't the best at
making events happen in order.

> P.S.  Also would it be possible to make the user div (user_content) do
> a blind_left/blind_right type of action?  To give the impression to
> the person that the data is actually moving in front of him type thing.
>

I don't think scriptaculous has that kind of motion currently, you could
code it up though :-)

--
Matthew Beale :: 607 227 0871
Resume & Portfolio @ http://madhatted.com
This topic is locked and can not be replied to.