Spry effects overview
Spry effects are visual enhancements that you can apply to almost any element on an HTML page using JavaScript. Effects are often used to highlight information, create animated transitions, or alter a page element visually for a duration of time. You can apply effects to HTML elements without needing additional custom tags.
Effects can alter an element’s opacity, scale, position, and styling properties such as background color. You can create interesting visual effects by combining two or more properties.
Because these effects are Spry-based, when a user clicks on an element with an effect, only that element is dynamically updated, without refreshing the entire HTML page.
Spry includes these effects:
- Appear/Fade
- Makes an element appear or fade away.
- Highlight
- Changes the background color of an element.
- Blind
- Simulates a window blind that goes up or down to hide or reveal the element.
- Slide
- Moves the element up or down.
- Grow/Shrink
- Increases or reduces the size of the element.
- Shake
- Simulates shaking the element from left to right.
- Squish
- Makes the element disappear into the upper-left corner of the page.
For a comprehensive overview of the Spry effects available in the Spry framework, visit www.adobe.com/go/learn_dw_spryeffects.
Apply an Appear/Fade effect
- (Optional) Select the content or layout element you want to apply the effect to.
- In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select Effects > Appear/Fade from the menu.
- Select the element’s ID from the target element menu. If you already selected an element, choose <Current Selection>.
- In the Effect Duration box, define the time it takes for the effect to occur, in milliseconds.
- Select the effect you want to apply: Fade or Appear.
- In the Fade From box, define the percentage of opacity you want the effect to have when it appears.
- In the Fade To box, define the percentage of opacity you want to fade to.
- Select Toggle Effect if you want the effect to be reversible, going from fade to appear and back again with successive clicks.
Apply a Blind effect
- (Optional) Select the content or layout element you want to apply the effect to.
- In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select Effects > Blind from the menu.
- Select the element’s ID from the target element menu. If you already selected an element, choose <Current Selection>.
- In the Effect Duration box, define the time it takes for the effect to occur, in milliseconds.
- Select the effect you want to apply: Blind Up or Blind Down.
- In the Blind Up From/Blind Down From box, define the blind-scrolling starting point as a percentage or as a pixel number. These values are calculated from the top of the element.
- In the Blind Up To/Blind Down To field, define the blind-scrolling end point as a percentage or as a pixel number. These values are calculated from the top of the element.
- Select Toggle Effect if you want the effect to be reversible, scrolling up and down with successive clicks.
Apply a Grow/Shrink effect
- (Optional) Select the content or layout element you want to apply the effect to.
- In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select Effects > Grow/Shrink from the popup menu.
- Select the element’s ID from the target element pop-up menu. If you have already selected an element, choose <Current Selection>.
- In the Effect Duration field, define the time it takes for the effect to occur, in milliseconds.
- Select the effect you want to apply: Grow or Shrink.
- In the Grow/Shrink From box, define the element’s size when the effect starts. This is a percentage of the size or a pixel value.
- In the Grow/Shrink To box, define the element’s size when the effect ends. This is a percentage of the size or a pixel value.
- If you choose pixels for either the Grow/Shrink From or To boxes, the wide/high field becomes visible. Depending on the option you choose, the element will grow or shrink proportionately.
- Select whether you want the element to grow or shrink to the upper-left corner of the page or into the page’s center.
- Select Toggle Effect if you want the effect to be reversible, growing and shrinking with successive clicks.
Apply a Highlight effect
- (Optional) Select the content or layout element you want to apply the effect to.
- In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select Effects > Highlight from the menu.
- Select the element’s ID from the target element menu. If you already selected an element, choose <Current Selection>.
- In the Effect Duration box, define how long you want the effect to last, in milliseconds.
- Select the color you want the highlight to start with.
- Select the color you want the highlight to end with. This color lasts only as long as the duration you define in Effect Duration.
- Select the color for the element after the highlight has finished.
- Select Toggle Effect if you want the effect to be reversible, cycling through the highlight colors with successive clicks.
Apply a Shake effect
- (Optional) Select the content or layout element you want to apply the effect to.
- In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select Effects > Shake from the menu.
- Select the element’s ID from the target element menu. If you have already selected an element, choose <Current Selection>.
Apply a Slide effect
For the Slide effect to work properly the target element must be wrapped in a container tag that has a unique ID. The container tag with which you wrap the target element must be a blockquote, dd, form, div, or center tag.
The target element tag must be one of the following: blockquote, dd,div, form, center, table, span, input, textarea, select, or image.
- (Optional) Select the container tag of the content you want to apply the effect to.
- In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select Effects > Slide from the menu.
- Select the container tag’s ID from the target element menu. If the container is already selected, choose <Current Selection>.
- In the Effect Duration field, define the time it takes for the effect to occur, in milliseconds.
- Select the effect you want to apply: Slide Up or Slide Down.
- In the Slide Up From box, define the sliding starting point as a percentage or as a pixel number.
- In the Slide Up To box, define the sliding end point as a percentage or as a positive pixel number.
- Select Toggle Effect if you want the effect to be reversible, sliding up and down with successive clicks.
Apply a Squish effect
- (Optional) Select the content or layout element you want to apply the effect to.
- In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select Effects > Squish from the menu.
- Select the element’s ID from the target element menu. If you have already selected an element, choose <Current Selection>.
Add an additional effect
You can associate multiple effect behaviors with the same element to produce interesting results.
- (Optional) Select the content or layout element you want to apply the effect to.
- In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select an effect from the Effects menu.
- Select the element’s ID from the target element menu. If you have already selected an element, choose <Current Selection>.
Delete an effect
You can remove one or more effect behaviors from an element.
- (Optional) Select the content or layout element you want to apply the effect to.
- In the Behaviors panel (Window > Behaviors), click the effect you want to delete from the list of behaviors.
- Do one of the following:
Click the Remove Event button in the subpanel title bar (-).
Right-click (Windows) or Control-click (Macintosh) the behavior, and select Delete Behavior.
