Shake effect using Jquery UI

Syntax of Shake effect using Jquery UI.

$( "#element" ).effect( "shake",{times:value,distance:value,direction:value},speed,function(){

Here we have given "shake " as effect. All other parameters are optional

Let us start with default shake effect, d1 is id of our div layer.
$( "#d1" ).effect( "shake" );
Usually it is connected to Click event of a button, here button id is b1
$( "#d1" ).effect( "shake" );
We can add optional parameter times to manage number of time the effect should happen.
$( "#d1" ).effect( "shake",{times:4});
Similarly we can add distance in pixels
$( "#d1" ).effect( "shake",{distance:200});
WE can add callback function to this, the function will display an alert window with message once the shake effect is over.

Here is the code with all optional values
$( "#d1" ).effect( "shake",{times:10,distance:200},5000,function(){
alert('This alert is created by using callback function once the effect is over');
} );

Post your comments , suggestion , error , requirements etc here .

Most Popular JQuery Scripts


Two dependant list boxes


Calendar with Date Selection


Data change by Slider


Show & Hide element

JQuery Video Tutorials

We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2021 All rights reserved worldwide Privacy Policy Disclaimer