Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Progress Indicator Helper (See related posts)

Use the optional options param to pass custom show or hide functions. Provides functions show/hide.
function ProgressIndicator(element, options) {
        var element = $(element);
        var my_options = {show:Element.show, hide:Element.hide};
        Object.extend(my_options, options || {});
        this.show = function() { my_options.show(element) }
        this.hide = function() { my_options.hide(element) }
        this.hide();
}

Example
var p = new ProgressIndicator($("my_element"));
p.show();

var q = new ProgressIndicator("my_other_element",
                             {show: Effect.Appear, 
                              hide:Effect.Fade});
q.show();
$("my_other_element").onclick = q.hide;


Requires prototype for a few things.

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts