t

Loading Panel Widget

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

                                     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,188건
+
제목 글쓴이 날짜 조회
12-08-29 조회 4,152
12-08-07 조회 3,813
12-08-03 조회 3,631
12-07-31 조회 3,739
12-07-30 조회 3,687
12-07-16 조회 3,890
12-07-15 조회 3,719
12-07-07 조회 3,578
12-07-06 조회 3,787
12-07-03 조회 3,743
12-06-29 조회 3,356
12-06-22 조회 3,734
12-06-17 조회 3,987
12-05-21 조회 3,907
12-05-02 조회 3,441
12-05-02 조회 4,237
12-05-02 조회 3,358
12-04-30 조회 3,547
12-04-30 조회 3,231
12-03-17 조회 4,096
12-03-10 조회 3,430
12-03-08 조회 3,953
12-03-03 조회 3,666
12-02-27 조회 5,078
12-02-17 조회 4,376
12-02-16 조회 4,646
12-02-03 조회 3,328
12-01-31 조회 3,232
12-01-24 조회 3,228
12-01-17 조회 3,932
12-01-05 조회 3,480
11-12-30 조회 3,210
11-12-23 조회 4,768
11-12-08 조회 3,528
11-12-07 조회 4,495
11-11-27 조회 3,912
11-11-25 조회 4,246
11-11-23 조회 3,696
11-11-22 조회 3,553
11-11-09 조회 3,255
11-10-23 조회 3,191
11-10-19 조회 3,150
11-10-08 조회 2,838
11-10-04 조회 2,835
11-10-04 조회 5,288
11-09-01 조회 4,369
11-08-13 조회 2,550
11-08-06 조회 3,228
11-07-11 조회 3,619
11-06-27 조회 2,990
11-06-21 조회 2,654
11-06-13 조회 2,454
11-06-07 조회 2,465
11-05-26 조회 2,427
11-04-20 조회 2,755
11-03-21 조회 2,855
11-03-18 조회 2,543
11-03-11 조회 2,562
11-02-07 조회 2,391
11-01-18 조회 2,715
11-01-12 조회 2,438
11-01-06 조회 2,530
10-12-10 조회 2,784
10-12-09 조회 2,644
10-12-08 조회 5,070
10-11-29 조회 2,909
10-11-28 조회 2,811
10-11-28 조회 2,652
10-11-19 조회 2,835
10-11-04 조회 2,712
10-10-21 조회 2,440
10-10-19 조회 3,398
10-10-12 조회 2,717
10-10-07 조회 2,550
10-09-30 조회 3,509
10-09-17 조회 3,922
10-09-17 조회 3,870
10-05-31 조회 3,574
09-12-31 조회 3,708
09-07-23 조회 5,034
08-09-16 조회 3,236
08-09-06 조회 2,983
08-09-04 조회 3,406
08-08-16 조회 4,438
08-08-15 조회 3,306
08-08-14 조회 4,517
08-08-12 조회 3,988
08-07-23 조회 2,806
08-07-10 조회 3,755
08-07-04 조회 2,978
08-06-27 조회 7,619
08-06-19 조회 4,925
08-05-27 조회 5,535
08-05-25 조회 5,369
08-05-23 조회 3,443
08-05-23 조회 4,613
08-05-21 조회 4,958
08-05-20 조회 4,081
08-05-20 조회 3,307
08-04-18 조회 4,360