Ajax question

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.

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.

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 :slight_smile: