//****************************************************************************** // Loading interface // // use JQuery // parameters : // parent : specify the parent of loading component // id : component id ( for css style ) //****************************************************************************** var Loading = Class.create( { initialize:function( parameters ) { //Init parameters this.parent = parameters.parent; this.id = parameters.id; this.className = parameters.className ? parameters.className : false; //Create loading component this.loadingDiv = $( document.createElement( "div" ) ); this.loadingDiv.attr( {id:this.id, class:"loading-classic"} ); if( this.className ) this.loadingDiv.addClass( this.className ); this.parent.append( this.loadingDiv ); this.hide(); } , display:function() { this.loadingDiv.show(); }, hide:function() { this.loadingDiv.hide(); } } );