t

Loading Panel Widget

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

                                     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-04-10 조회 3,823
12-04-06 조회 5,268
12-04-06 조회 3,037
12-04-04 조회 4,121
12-04-02 조회 3,467
12-03-30 조회 3,404
12-03-29 조회 5,887
12-03-28 조회 3,302
12-03-28 조회 4,206
12-03-27 조회 4,434
12-03-23 조회 3,696
12-03-21 조회 3,420
12-03-20 조회 3,220
12-03-18 조회 3,050
12-03-15 조회 3,220
12-03-12 조회 3,261
12-03-12 조회 3,237
12-03-08 조회 3,528
12-03-03 조회 3,586
12-03-03 조회 3,197
12-02-29 조회 3,409
12-02-28 조회 3,489
12-02-28 조회 3,308
12-02-28 조회 3,416
12-02-27 조회 3,826
12-02-27 조회 3,212
12-02-24 조회 3,416
12-02-24 조회 3,233
12-02-23 조회 3,636
12-02-20 조회 3,522
12-02-20 조회 4,019
12-02-17 조회 3,991
12-02-16 조회 3,084
12-02-15 조회 3,356
12-02-15 조회 3,503
12-02-14 조회 3,405
12-02-08 조회 3,415
12-02-06 조회 3,388
12-02-06 조회 3,824
12-01-25 조회 4,079
12-01-21 조회 3,977
12-01-20 조회 6,096
12-01-15 조회 3,595
12-01-15 조회 3,552
12-01-14 조회 3,449
12-01-14 조회 3,590
12-01-14 조회 3,318
12-01-12 조회 3,926
12-01-12 조회 4,201
12-01-10 조회 3,529
12-01-10 조회 4,325
12-01-09 조회 3,689
12-01-08 조회 6,955
12-01-08 조회 3,159
12-01-07 조회 3,509
12-01-06 조회 3,523
12-01-04 조회 3,665
12-01-03 조회 3,525
12-01-02 조회 3,920
12-01-02 조회 3,116
12-01-01 조회 4,036
12-01-01 조회 3,384
11-12-31 조회 3,633
11-12-31 조회 3,743
11-12-31 조회 3,578
11-12-30 조회 3,805
11-12-30 조회 4,989
11-12-30 조회 4,103
11-12-30 조회 4,257
11-12-30 조회 3,732
11-12-30 조회 3,454
11-12-30 조회 3,419
11-12-29 조회 3,179
11-12-22 조회 3,383
11-12-21 조회 3,283
11-12-20 조회 3,596
11-12-15 조회 5,377
11-12-15 조회 4,392
11-12-14 조회 5,410
11-12-12 조회 3,605
11-12-03 조회 3,363
11-11-26 조회 3,392
11-11-19 조회 3,670
11-11-01 조회 2,970
11-10-23 조회 2,633
11-10-21 조회 2,612
11-10-15 조회 3,117
11-10-15 조회 2,853
11-10-15 조회 3,522
11-10-15 조회 2,750
11-10-14 조회 2,789
11-10-13 조회 2,562
11-10-11 조회 2,808
11-10-10 조회 2,628
11-09-30 조회 3,493
11-09-30 조회 2,917
11-09-29 조회 4,717
11-09-29 조회 2,607
11-09-23 조회 2,630
11-09-16 조회 2,965