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.
3324a49b1605f0e2df7676ff64f5e712?d=identicon&s=25 Mohammad Ruby (mohammad)
on 2006-04-16 17: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
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-04-16 17: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?
3324a49b1605f0e2df7676ff64f5e712?d=identicon&s=25 Mohammad Ruby (mohammad)
on 2006-04-16 21: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?
C29d9db03853958c4de5ee6b06edd39a?d=identicon&s=25 Nicolas Buet (Guest)
on 2006-04-16 21: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.