O'Reilly logo

Prototype and Scriptaculous: Taking the Pain out of JavaScript by Chris Angus

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1.3. Creating Effects Without Scriptaculous

Writing visual effects in raw JavaScript is hard—very hard! If you want to know how hard it is, then just have a go. The good news is that with Scriptaculous, it is trivial. To create a simple wipe-down effect, we may do the following:

<div id="e1"><p>element to wipe</p></div>

<script>

          function wipeDown()
          {
                 Effect.BlindDown("el");
          }

</script>

<a href="javascript; void (wipeDown())">click to run effect</a>

Doing this in raw JavaScript is left as a very optional and not-particularly-recommended exercise for the reader.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required