04.02.2013 Views

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 4: Working with <strong>Spry</strong> Effects<br />

About <strong>Spry</strong> effects<br />

About <strong>Spry</strong> effects<br />

Effects are visual enhancements that you can apply to almost any element on an HTML page. For example, an effect<br />

might highlight information, create animated transitions, or visually alter a page element for a certain period of time.<br />

Effects are a simple but elegant way of enhancing the look and feel of your website.<br />

Effects refer to JavaScript methods and functions that reside on the client, and don't require any server-side logic or<br />

scriptingtowork.Thus,whenauserbrowsesanHTMLpageandtriggersaneffect,onlytheobjecttowhichtheeffect<br />

is applied gets updated: there is no need to refresh the entire page.<br />

The <strong>Spry</strong> framework for AJAX includes these effects:<br />

Fade Makes an element appear or fade away.<br />

Highlight Changes the background color of an element.<br />

Blind up/down Simulates a window blind that moves up or down to hide or reveal the element.<br />

Slide up/down Moves the element up or down.<br />

Grow Increases or reduces the size of the element.<br />

Shake Simulates shaking the element from left to right.<br />

Squish Makes the element disappear into the upper-left corner of the page.<br />

<strong>Adobe</strong> designed <strong>Spry</strong> effects to be easy to implement on the page while letting the framework do the real work. No<br />

new tags or strange syntaxes are required. The HTML element to which you apply the effect does not require any<br />

custom tags.<br />

Note: Several effects libraries are available and <strong>Adobe</strong> recognizes the community's acceptance of Script.aculo.us as a<br />

well-written library. With that in mind, <strong>Adobe</strong> has adopted the their list of effects as well as their nomenclature and has<br />

implemented several Script.aculo.us solutions for browser issues related to effects. <strong>Adobe</strong> acknowledges the work that<br />

Thomas Fuchs of Script.aculo.us has done and hopes that the community recognizes both libraries as useful and viable.<br />

Additionally, <strong>Adobe</strong> has worked to make sure that developers can use both libraries on a single page.<br />

About the <strong>Spry</strong> effects library<br />

The <strong>Spry</strong> Effects library, in the <strong>Spry</strong>Effects.js file, includes all of the <strong>Spry</strong> effects that are available on <strong>Adobe</strong> Labs.<br />

The file has no other dependencies.<br />

Before you add effects to a page, you link the <strong>Spry</strong>Effects.js file in the head of the HTML document, as follows:<br />

<br />

Note: The exact file path differs, depending on where you store the <strong>Spry</strong>Effects.js file.<br />

Both the JavaScript file and the HTML file that contains the effects must reside on your server for <strong>Spry</strong> effects to work.<br />

141

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

Saved successfully!

Ooh no, something went wrong!