I made a plugin for this .. check it out http://static.mbiosinformatica.com.br/jQuery/
Does it work in IE (7, 8, 9), Chrome and Firefox.
And you can apply the callback function, show the error message .. or anything else.
$('#div').shake({ positions : { 'L' : 50 , 'R' : 50 } , // shake only left and right (U,L,R,D) rotate : false , // rotate div on shake .. true/false parent : false // shake parent div .. true/false }, function(){ /* do something */ });
In positions you can also send an array: positions: [ [ 'L', 50 ... ] ] This value of " 50 " corresponds to the distance from the original position.
To change the timeout (delay) and duration of the effect, you must set the timeout: [you timeout .. / delay ] and the response time. interval: ...
user862010
source share