t

Loading Panel Widget

· 2011-11-01 (화) 17:47:24 · 3222

                                     A YUI Loading Panel Widget


아래를 추가해서 사용하세요.
var loadingPanel = new yuiLoadingPanel();

//loadingPanel.show();
//loadingPanel.show("Processing...");
//loadingPanel.hide();

The user can close the loading box by clicking on the cancel link. If you want to handle this situation, you can subscribe to the cancelEvent:

loadingPanel.cancelEvent.subscribe(function(e, a, o){
  alert('You clicked cancel!');
});

loadingpanel.js:

$D = YAHOO.util.Dom;
$E = YAHOO.util.Event;
var yuiLoadingPanel = function(conf){
    conf = conf == undefined ? new Array() : conf;
    conf.id = conf.id == undefined ? 'yuiLoadingPanel':confi.id;
    conf.header = conf.header == undefined ? 'Loading, please wait...':conf.header;
    conf.width = conf.width == undefined ? '240px':conf.width;
    this.conf = conf;
    this.cancelEvent = new YAHOO.util.CustomEvent("cancelEvent", this);
    this.init();
	
};

yuiLoadingPanel.prototype = {
    init:function(){
        var loadingPanel = new YAHOO.widget.Panel(this.conf.id,{
            width:this.conf.width,
	    fixedcenter:true,
            close:false,
            draggable:false,
            modal:true,
            visible:false
        });
    
       loadingPanel.setBody(this.conf.header + 
               '<img src="http://us.i1.yimg.com/us.yimg.com/i/us/per/gr/gp/rel_interstitial_loading.gif" />');
               loadingPanel.render(document.body);
               $D.addClass(loadingPanel.id, 'tcc_lightboxLoader');
               var cancelLink = document.createElement('a');
               $D.setStyle(cancelLink, 'cursor', 'pointer');
               cancelLink.appendChild(document.createTextNode('Cancel'));
               $E.on(cancelLink, 'click', function(e, o){
       	           o.self.loadingPanel.hide();
       	           o.self.cancelEvent.fire();
               }, {self:this});
               loadingPanel.appendToBody(document.createElement('br'));
               loadingPanel.appendToBody(cancelLink);
               $D.setStyle(loadingPanel.body, 'text-align', 'center');
               $D.addClass(document.body, 'yui-skin-sam');
        this.loadingPanel = loadingPanel;
    },
    show:function(text){
        if(text != undefined){
            this.loadingPanel.setHeader(text);
        }else{
	    this.loadingPanel.setHeader(this.conf.header);
	}
	this.loadingPanel.show();
    },
    hide:function(){
        this.loadingPanel.hide();
    }
};


댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,187건
+
제목 글쓴이 날짜 조회
12-01-08 조회 3,059
12-01-07 조회 3,664
12-01-07 조회 3,121
12-01-07 조회 3,029
12-01-07 조회 2,998
12-01-07 조회 5,252
12-01-06 조회 2,780
12-01-06 조회 3,494
12-01-06 조회 2,984
12-01-06 조회 2,938
12-01-06 조회 2,943
12-01-06 조회 5,649
12-01-06 조회 3,697
12-01-06 조회 2,892
12-01-06 조회 3,019
12-01-05 조회 3,080
12-01-05 조회 3,095
12-01-05 조회 2,805
12-01-05 조회 2,902
12-01-05 조회 3,549
12-01-05 조회 5,394
12-01-04 조회 3,839
12-01-04 조회 2,833
12-01-04 조회 2,777
12-01-04 조회 2,998
12-01-04 조회 2,838
12-01-04 조회 2,918
12-01-04 조회 3,075
12-01-04 조회 2,831
12-01-04 조회 5,241
12-01-04 조회 5,110
12-01-04 조회 2,969
12-01-04 조회 3,434
12-01-04 조회 3,108
12-01-04 조회 2,930
12-01-04 조회 5,427
12-01-04 조회 4,596
12-01-04 조회 4,081
12-01-04 조회 3,948
12-01-04 조회 2,774
12-01-03 조회 3,663
12-01-03 조회 2,643
12-01-03 조회 2,667
12-01-03 조회 2,670
12-01-02 조회 3,165
12-01-02 조회 3,222
12-01-02 조회 4,066
12-01-02 조회 3,035
12-01-02 조회 3,252
12-01-02 조회 3,517
12-01-02 조회 3,515
12-01-01 조회 2,716
12-01-01 조회 4,192
12-01-01 조회 3,162
12-01-01 조회 3,536
11-12-31 조회 3,473
11-12-31 조회 3,805
11-12-31 조회 3,906
11-12-31 조회 3,142
11-12-31 조회 3,293
11-12-31 조회 3,730
11-12-30 조회 3,986
11-12-30 조회 3,268
11-12-30 조회 3,324
11-12-30 조회 3,968
11-12-30 조회 5,153
11-12-30 조회 4,255
11-12-30 조회 4,426
11-12-30 조회 3,889
11-12-30 조회 3,609
11-12-30 조회 3,630
11-12-30 조회 3,476
11-12-30 조회 2,670
11-12-30 조회 3,837
11-12-30 조회 7,112
11-12-29 조회 3,683
11-12-29 조회 3,366
11-12-29 조회 3,032
11-12-29 조회 3,248
11-12-29 조회 3,104
11-12-28 조회 2,728
11-12-28 조회 2,875
11-12-28 조회 3,008
11-12-28 조회 2,932
11-12-28 조회 3,795
11-12-27 조회 3,152
11-12-27 조회 2,918
11-12-27 조회 2,822
11-12-27 조회 2,936
11-12-26 조회 3,258
11-12-26 조회 3,157
11-12-26 조회 3,734
11-12-26 조회 3,367
11-12-26 조회 5,924
11-12-25 조회 3,090
11-12-23 조회 3,642
11-12-23 조회 3,585
11-12-23 조회 5,160
11-12-23 조회 4,816
11-12-23 조회 2,904