04.02.2013 Views

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Click here to<br />

highlight the below paragraph.<br />

The first argument of the JavaScript method is always the target element’s ID ('highlight1' in the preceding<br />

example).<br />

The complete code looks as follows:<br />

<br />

. . .<br />

<br />

<br />

<br />

Click here to<br />

highlight the below paragraph.<br />

Lorem ipsum dolor sit amet, consetetur sadipscing<br />

elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed<br />

diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.<br />

<br />

Highlight effect options<br />

The following table lists the available options for the Highlight effect.<br />

Option Description<br />

duration The duration of the effect in milliseconds. The default value is 1000.<br />

from Start color value in RGB color format (#RRGGBB). This value sets the color of the<br />

first frame of the highlight. The default is the background color of the target<br />

element.<br />

to End color value in RGB color format (#RRGGBB). This value sets the color of the<br />

last frame of the highlight.<br />

toggle Produces a toggle effect. The default value is false. If the value is set to true,<br />

the restoreColor option is ignored.<br />

transition Determines the type of transition: linear (transition speed is constant for the<br />

duration of the transition) or sinusoidal (effect begins slowly, then speeds up,<br />

then slows again at the end). The default is sinusoidal.<br />

setup Lets you define a function that is called before the effect begins, e.g.,<br />

setup:function (element,effect){/* ... */}.<br />

finish Lets you define a function that is called after the effect finishes, e.g.,<br />

finish:function (element,effect){/* ... */}.<br />

Sample code:<br />

<strong>Spry</strong>.Effect.DoHighlight('targetID', {duration:1000,from:'#00ff00',to:'#0000ff'});<br />

Attach a Fade effect<br />

The Fade effect makes an element appear or fade away.<br />

You can attach the Fade effect to any HTML element except applet, body, iframe, object, tr, tbody, or th.<br />

1 To link the <strong>Spry</strong>Effects.js file on your web page, add the following code to the head of your document:<br />

SPRY<br />

<strong>User</strong> <strong>Guide</strong><br />

143

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!