schedule – Scheduled/Deferred Actions for jQuery

The jQuery Schedule plugin can perform scheduled/deferred actions on DOM elements. Imagine things like …

  • Make a good old support chat that fetches messages every 2 seconds.
  • Popout the nagging Newsletter-Subscription after 10 Seconds.
  • Animations manged by jQuery Schedule.

Examples

Animations, yay!

Just think about paralax.

Source code

<div id="first-animation" style="background: #00f; width: 150px; height: 100px"></div>

<button id="first-button">GO!</button>
jQuery(
    function () {
        $ = jQuery;
        jQuery( '#first-button' ).click(
            function () {
                jQuery( '#first-animation' ).schedule(
                    '1s', function () {
                        $( this ).css( 'background-color', '#f00' );
                    }
                ).schedule(
                    '2s', function () {
                        $( this ).css( 'background-color', '#0f0' );
                    }
                ).schedule(
                    '3s', function () {
                        $( this ).css( 'background-color', '#00f' );
                    }
                )
            }
        )
    }
);

Asynchron is the best part of it

More: https://github.com/rse/jquery-schedule