Forum: Ruby on Rails AJAX multi actions?

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.
Mohammad R. (Guest)
on 2006-04-16 19:52
How can I do something like this:
<a id=a7 style="cursor: pointer;"
  onClick = "new Effect.Fade ('li');
  Element.show('a1','a2','a3','a5','a6');
  onClick = "new Effect.Fade ('rp');
  Element.show('a1','a2','a3','a5','a6');"> Hide Images</a>
Whenever I do this it doesn't work,
Thanks in advance
Alex Y. (Guest)
on 2006-04-16 19:58
(Received via mailing list)
Mohammad Surname? wrote:
> How can I do something like this:
> <a id=a7 style="cursor: pointer;"
>   onClick = "new Effect.Fade ('li');
>   Element.show('a1','a2','a3','a5','a6');
>   onClick = "new Effect.Fade ('rp');
>   Element.show('a1','a2','a3','a5','a6');"> Hide Images</a>
> Whenever I do this it doesn't work,
What should it be doing?  What are 'li' and 'rp', and why do you have
two onClicks defined on a single element?
Mohammad R. (Guest)
on 2006-04-16 23:31
<img src="/images/login.gif" id="li"><br>
<img src="/images/rails.png" id="rp"><br>
  <a id=a7 style="cursor: pointer;"
  onClick = "new Effect.Appear ('li');
  Element.show('a1','a2','a3','a5','a6');
  new Effect.Appear ('rp');
  Element.show('a1','a2','a3','a5','a6');"> Veiw Images</a> |
  <a id=a7 style="cursor: pointer;"
  new Effect.Fade ('li');
  Element.show('a1','a2','a3','a5','a6');
  onClick = "new Effect.Fade ('rp');
  Element.show('a1','a2','a3','a5','a6');"> Hide Images</a>

Sorry about that,
If you hit veiw images it only show login.gif if you hit hide it hides
rails.png so is there a way I could make it hide all of the images on
one click? Without having to make a javascript funticion?
Nicolas B. (Guest)
on 2006-04-16 23:39
(Received via mailing list)
you can either use rails 1.1 & a rjs template (search in the list for
some
help about that), or write your javascript function (onclick="f()")
This topic is locked and can not be replied to.