t

Loading Panel Widget

· 14년 전 · 1699

                                     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,615
14년 전 조회 1,552
14년 전 조회 1,545
14년 전 조회 1,256
14년 전 조회 1,519
14년 전 조회 2,524
14년 전 조회 1,078
14년 전 조회 3,083
14년 전 조회 1,396
14년 전 조회 1,112
14년 전 조회 1,082
14년 전 조회 1,374
14년 전 조회 1,283
14년 전 조회 1,190
14년 전 조회 1,680
14년 전 조회 1,115
14년 전 조회 1,750
14년 전 조회 2,157
14년 전 조회 1,102
14년 전 조회 1,221
14년 전 조회 1,068
14년 전 조회 1,245
14년 전 조회 1,657
14년 전 조회 1,359
14년 전 조회 1,495
14년 전 조회 1,289
14년 전 조회 1,478
14년 전 조회 1,043
14년 전 조회 1,892
14년 전 조회 1,232
14년 전 조회 1,994
14년 전 조회 8,761
14년 전 조회 1,338
14년 전 조회 2,174
14년 전 조회 1,948
14년 전 조회 2,209
14년 전 조회 2,557
14년 전 조회 1,140
14년 전 조회 1,276
14년 전 조회 7,074
14년 전 조회 1,245
14년 전 조회 1,150
14년 전 조회 2,361
14년 전 조회 1,241
14년 전 조회 1,210
14년 전 조회 2,704
14년 전 조회 1,296
14년 전 조회 4,233
14년 전 조회 4,366
14년 전 조회 1,700
14년 전 조회 1,272
14년 전 조회 1,920
14년 전 조회 1,210
14년 전 조회 1,492
14년 전 조회 1,089
14년 전 조회 7,977
14년 전 조회 1,625
14년 전 조회 1,025
14년 전 조회 1,190
14년 전 조회 1,881
14년 전 조회 1,336
14년 전 조회 1,180
14년 전 조회 1,275
14년 전 조회 1,212
14년 전 조회 1,071
14년 전 조회 1,201
14년 전 조회 1,173
14년 전 조회 1,188
14년 전 조회 1,209
14년 전 조회 1,496
14년 전 조회 1,482
14년 전 조회 1,726
14년 전 조회 1,373
14년 전 조회 1,283
14년 전 조회 1,203
14년 전 조회 1,128
14년 전 조회 1,142
14년 전 조회 1,311
14년 전 조회 2,523
14년 전 조회 1,202
14년 전 조회 1,520
14년 전 조회 2,678
14년 전 조회 1,779
14년 전 조회 1,524
14년 전 조회 5,267
14년 전 조회 2,482
14년 전 조회 1,323
14년 전 조회 1,207
14년 전 조회 1,154
14년 전 조회 1,075
14년 전 조회 2,339
14년 전 조회 3,673
14년 전 조회 1,152
14년 전 조회 1,356
14년 전 조회 2,325
14년 전 조회 1,173
14년 전 조회 1,825
14년 전 조회 2,177
14년 전 조회 1.1만
14년 전 조회 1,700