A jQuery interaction widget enables visitors to your page to use a mouse (or trackpad or touchscreen) to control, modify, or in some other way play with a web page element. Here's a quick look at the available effects offered by jQuery UI:
blind: Hides or shows an element as though the element was a window blind that you pull up or down. As an option, you can set thedirectionproperty toup,down,left,right,vertical, orhorizontal.
$('#my-div').toggle('blind',{direction: 'left'});
bounce: Bounces an element up and down. As options, you can use thedistanceproperty to set the maximum bounce height (in pixels), and thetimesproperty to set the number of bounces.
$('#my-div').effect('bounce',
{
distance: 200,
times: 10
},
1500
);
clip: Hides or shows an element by shrinking the element vertically from the top and bottom. Set thedirectionproperty tohorizontalto clip the element horizontally.
$('#my-div').toggle('clip');
drop: Hides or shows an element by fading the element out or in while simultaneously sliding the element left or right. As an option, you can set thedirectionproperty toup,down,left, orright.
$('#my-div').toggle('drop',{direction: 'up'});
explode: Hides an element by exploding it into pieces that fly off in all directions; shows an element by restoring the exploded pieces to their original configuration. You can set thepiecesproperty to the number of pieces to explode; the value should be a square, such as16or25(the default is9).
$('#my-div').toggle('explode',{pieces: 16});
fade: Hides or shows an element by fading the element out or in.
$('#my-div').toggle('fade', 'slow');
fold: Hides an element by first shrinking it vertically to a 15-pixel height (the first “fold”), and then shrinking it horizontally until it disappears (the second “fold”); shows an element by reversing the folding procedure. For options, you can use thesizeproperty to set the height, in pixels, after the first fold (the default is15); you can set thehorizFirstproperty totrueto make the first fold horizontal rather than vertical.
$('#my-div').toggle('fold',{size: 50});
highlight: Highlights the background of an element. Use thecolorproperty to specify the highlight color as an RGB triplet (the default is#ffff99).
$('#my-div').effect('highlight',{color: 'ffd700'});
puff: Hides or shows an element by scaling the element larger or smaller while simultaneously fading the element out or in. Add the percent property to set the maximum scale percentage (the default is150).
$('#my-div').toggle('puff',{percent: 200});
pulsate: Pulsates an element by quickly oscillating its opacity between0and1. Use thetimesproperty to set the number of oscillations (the default is5).
$('#my-div').effect('pulsate',{times: 10});
scale: Grows or shrinks an element. For options, you can set thedirectionproperty tohorizontal,vertical, orboth(the default); you can use theoriginproperty to set the vanishing point as an array of the form['<em>h</em>','<em>v</em>'], wherehistop,middle, orbottom, andvisleft,center, orright(the default is['middle','center']); you can use thepercentproperty to set thescalefactor; and you can set the scale property tobox,content, orboth(the default).
$('#my-div').effect('scale',{percent: 25, origin: ['top','left']});
shake: Shakes an element horizontally or vertically. As options, you can set thedirectionproperty to either left (the default) or right for a horizontal shake, or toupordownfor a vertical shake; you can use thedistanceproperty to set the shake displacement, in pixels (the default is20); and you can set thetimesproperty to set the number of shakes (the default is3).
$('#my-div').effect('shake',
{
distance: 10,
times: 10
},
1000
);
size: Changes the dimensions of an element to a specified width and height. You set the new dimensions by adding thetoproperty as an option and setting it to an object literal that specifies thewidthandheight, in pixels. You can also use theoriginproperty to set the resize fixed point as an array of the form['<em>h</em>','<em>v</em>'], wherehistop,middle, orbottom, andvisleft,center, orright(the default is['top','left']); and you can set thescaleproperty tobox,content, orboth(the default).
$('#my-div').effect('size',{to: {width: 200, height: 100}});
slide: Hides or shows an element by sliding it out of or into the viewport. For options, you can use thedirectionproperty to set the direction of the slide toleft(the default),right,up, ordown; you can use thedistanceproperty to set the length of the slide, in pixels (the default is the width of the element ifdirectionisleftorright, or the height of the element ifdirectionisupordown).


