ATTENTION ATTENTION
gear.huuah.com has launched. Visit the shop at http://gear.huuah.com/. Lots of Photo Gear at the moment
ATTENTION ATTENTION
Itsplanned.com is just launched! - Task and project management made easy. Try it for free.

Create your own lists of things to do - arrange the order to do them - move them around - group them

No limitations - all free project management - try the free demo before signing up - demo: itsplanned.com
jQuery shake / attention plugin
17.11.2010

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.

3 Responses to “jQuery shake / attention plugin”

  1. DToma Says:

    If you have a div centered with margin left/right. And after is shakes it aligns the div on the left.

  2. ocopmat Says:

    you need to have a div inside a div..

  3. ocopmat Says:

    they should also have the same attribute

Leave a Reply