RJS visual_effect toggle?

Is there a way to toggle an effect in an RJS? If not, anyone have
recommendations for how to manually make it toggle? I guess I would
assume some boolean that the rjs checks everytime it’s called and
depending on whether it’s true or false it will do page.visual_effect
:appear or page.visual_effect :hide

-Ben L.

Ben L. wrote:

Is there a way to toggle an effect in an RJS? If not, anyone have
recommendations for how to manually make it toggle? I guess I would
assume some boolean that the rjs checks everytime it’s called and
depending on whether it’s true or false it will do page.visual_effect
:appear or page.visual_effect :hide

-Ben L.

nvm found it. Two ways of doing it:

  1. page.toggle ‘element’
  2. page.visual_effect :toggle_appear,‘element’

can replace :toggle_appear with :toggle_slide and :toggle_blind

-Ben L.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs