Getting peoples attention is sometimes needed, although it is often quite annoying when other people does it. You know. Shakes things on their webpages. Almost as annoying as webpages with background music.
In some situations it can actually be useful, if the user interface can take it. It’s all up to you.
Shake and attention plugin for jQuery
The shake and attention plugin for jQuery is easy to use and should be available on all selectable elements within jQuery.
This is the first version that gets published, so I would really appreciate all the feedback I can get.
What can it do
It can shake things left and right and right and left.
$(".shakethisbutton").shake();
Another shake:
$(".shakethisbutton1").click( function() {
$(this).shake({
shake_speed: 70,
shake_repeats: 10
});
});
Yet another shake
$(".shakethisbutton2").click( function() {
$(this).shake({
shake_random_length: 'yes',
shake_repeats: 10
});
});
Options
The complete list of settings for the Shake and Attention jQuery plugin is:
shake_random_length: 'no', // should we shake all the way every time or random shakes. 'yes'/'no'
shake_random_direction: 'no', // should the direction be left-right-left etc. or random. 'yes'/'no'
shake_left: 30, // how many pixels can we move to the left
shake_right: 30, // how many pixels can we move to the right
shake_speed: 100, // how fast to shake
shake_repeats: 1, // how many repetition
shake_easing: 'linear' // 'linear' or 'swing'
Support this
If you like this plugin please post a comment or perhaps make a small PayPal donation to support further development.
Download
Download shake-0.8.js here – download
Something is missing
Please post a comment if you have any comments for this jQuery plugin.

april 11th, 2011 at 02:43
If you have a div centered with margin left/right. And after is shakes it aligns the div on the left.
juni 3rd, 2011 at 17:25
you need to have a div inside a div..
juni 3rd, 2011 at 17:28
they should also have the same attribute