source: tapas/web/resources/js/classesForJQuery/Loading.js @ 382

Last change on this file since 382 was 382, checked in by vmipsl, 12 years ago

clean

File size: 1.0 KB
Line 
1//******************************************************************************
2// Loading interface
3//
4// use JQuery
5// parameters :
6// parent : specify the parent of loading component
7// id : component id ( for css style )
8//******************************************************************************
9
10var Loading = Class.create( {
11
12    initialize:function( parameters )
13    {
14        //Init parameters
15        this.parent = parameters.parent;
16        this.id = parameters.id;
17        this.className = parameters.className ? parameters.className : false;
18
19        //Create loading component
20        this.loadingDiv = $( document.createElement( "div" ) );
21        this.loadingDiv.attr( {id:this.id, class:"loading-classic"} );
22        if( this.className )
23            this.loadingDiv.addClass( this.className );
24        this.parent.append( this.loadingDiv );
25        this.hide();
26    } ,
27
28    display:function()
29    {
30        this.loadingDiv.show();
31    },
32
33    hide:function()
34    {
35        this.loadingDiv.hide();
36    }
37} );
Note: See TracBrowser for help on using the repository browser.