t

Loading Panel Widget

· 14년 전 · 1741

                                     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();
    }
};


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

프로그램

+
제목 글쓴이 날짜 조회
14년 전 조회 2,660
14년 전 조회 1,608
14년 전 조회 1,604
14년 전 조회 1,315
14년 전 조회 1,564
14년 전 조회 2,577
14년 전 조회 1,131
14년 전 조회 3,136
14년 전 조회 1,447
14년 전 조회 1,177
14년 전 조회 1,151
14년 전 조회 1,435
14년 전 조회 1,340
14년 전 조회 1,247
14년 전 조회 1,733
14년 전 조회 1,176
14년 전 조회 1,801
14년 전 조회 2,202
14년 전 조회 1,160
14년 전 조회 1,296
14년 전 조회 1,126
14년 전 조회 1,299
14년 전 조회 1,711
14년 전 조회 1,397
14년 전 조회 1,559
14년 전 조회 1,354
14년 전 조회 1,542
14년 전 조회 1,091
14년 전 조회 1,954
14년 전 조회 1,295
14년 전 조회 2,042
14년 전 조회 8,807
14년 전 조회 1,394
14년 전 조회 2,238
14년 전 조회 1,993
14년 전 조회 2,252
14년 전 조회 2,604
14년 전 조회 1,200
14년 전 조회 1,337
14년 전 조회 7,137
14년 전 조회 1,300
14년 전 조회 1,205
14년 전 조회 2,418
14년 전 조회 1,295
14년 전 조회 1,276
14년 전 조회 2,767
14년 전 조회 1,349
14년 전 조회 4,276
14년 전 조회 4,414
14년 전 조회 1,742
14년 전 조회 1,329
14년 전 조회 1,972
14년 전 조회 1,249
14년 전 조회 1,550
14년 전 조회 1,145
14년 전 조회 8,045
14년 전 조회 1,677
14년 전 조회 1,071
14년 전 조회 1,258
14년 전 조회 1,944
14년 전 조회 1,384
14년 전 조회 1,246
14년 전 조회 1,338
14년 전 조회 1,249
14년 전 조회 1,126
14년 전 조회 1,244
14년 전 조회 1,231
14년 전 조회 1,244
14년 전 조회 1,273
14년 전 조회 1,556
14년 전 조회 1,533
14년 전 조회 1,778
14년 전 조회 1,422
14년 전 조회 1,337
14년 전 조회 1,243
14년 전 조회 1,178
14년 전 조회 1,195
14년 전 조회 1,362
14년 전 조회 2,585
14년 전 조회 1,253
14년 전 조회 1,565
14년 전 조회 2,726
14년 전 조회 1,842
14년 전 조회 1,578
14년 전 조회 5,321
14년 전 조회 2,535
14년 전 조회 1,374
14년 전 조회 1,265
14년 전 조회 1,213
14년 전 조회 1,130
14년 전 조회 2,402
14년 전 조회 3,718
14년 전 조회 1,203
14년 전 조회 1,410
14년 전 조회 2,390
14년 전 조회 1,238
14년 전 조회 1,881
14년 전 조회 2,220
14년 전 조회 1.1만
14년 전 조회 1,753