Easy Script.aculo.us Effect

| | Comments (0) | TrackBacks (0)

With script.aculo.us javascript library it is absolutely easy to add nice visual gizmos to your page.

On my page is used prototype and scriptaculous lib.

<script src="../scripts/prototype.js" mcesrc="../scripts/prototype.js" type="text/javascript"></script> <script src="../scripts/scriptaculous.js" mcesrc="../scripts/scriptaculous.js" type="text/javascript"></script>

The part I actually used, was an Effect. Effects can be performed on <div> tags for example, essential is an existing unique id-attribute. So the target for the effect looked like this:

<div id="content"> <jsp:include flush="false" page="aPage.jsp"/> </div>

The Effect functions should work on all so called block elements.

ADDRESS BLOCKQUOTE BODY DD DIV DL DT FIELDSET FORM, FRAME FRAMESET H1, H2, H3, H4, H5, H6 IFRAME NOFRAMES OBJECT P OL, UL, LI APPLET CENTER DIR HR MENU PRE

I called the effect in the onclick-event of an anchor element, passing the div-id as the parameter.

<a href=”http://www.innoq.com/blog/ca/wordpress/#” mcehref=”http://www.innoq.com/blog/ca/wordpress/#”onclick=”Effect.toggle(‘content’,’slide’); return false”> <img src=”../images/minimize.gif” mcesrc=”../images/minimize.gif” alt=”” /> </a>

All available effects can be found here.

Categories

0 TrackBacks

Listed below are links to blogs that reference this entry: Easy Script.aculo.us Effect.

TrackBack URL for this entry: http://www.innoq.com/mt4/mt-tb.cgi/2460

Leave a comment

About this Entry

This page contains a single entry by Christian Albrecht published on October 18, 2006 9:22 AM.

Ruby Example was the previous entry in this blog.

JUG Cologne is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.0