t

Loading Panel Widget

· 14년 전 · 1734

                                     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,652
14년 전 조회 1,596
14년 전 조회 1,590
14년 전 조회 1,295
14년 전 조회 1,551
14년 전 조회 2,565
14년 전 조회 1,119
14년 전 조회 3,123
14년 전 조회 1,435
14년 전 조회 1,164
14년 전 조회 1,137
14년 전 조회 1,422
14년 전 조회 1,325
14년 전 조회 1,236
14년 전 조회 1,721
14년 전 조회 1,163
14년 전 조회 1,792
14년 전 조회 2,190
14년 전 조회 1,143
14년 전 조회 1,279
14년 전 조회 1,117
14년 전 조회 1,290
14년 전 조회 1,696
14년 전 조회 1,389
14년 전 조회 1,543
14년 전 조회 1,341
14년 전 조회 1,525
14년 전 조회 1,085
14년 전 조회 1,944
14년 전 조회 1,281
14년 전 조회 2,030
14년 전 조회 8,799
14년 전 조회 1,377
14년 전 조회 2,228
14년 전 조회 1,978
14년 전 조회 2,242
14년 전 조회 2,593
14년 전 조회 1,189
14년 전 조회 1,325
14년 전 조회 7,121
14년 전 조회 1,291
14년 전 조회 1,191
14년 전 조회 2,408
14년 전 조회 1,287
14년 전 조회 1,262
14년 전 조회 2,756
14년 전 조회 1,335
14년 전 조회 4,267
14년 전 조회 4,404
14년 전 조회 1,735
14년 전 조회 1,313
14년 전 조회 1,961
14년 전 조회 1,239
14년 전 조회 1,537
14년 전 조회 1,127
14년 전 조회 8,028
14년 전 조회 1,671
14년 전 조회 1,066
14년 전 조회 1,242
14년 전 조회 1,931
14년 전 조회 1,371
14년 전 조회 1,225
14년 전 조회 1,327
14년 전 조회 1,241
14년 전 조회 1,113
14년 전 조회 1,230
14년 전 조회 1,216
14년 전 조회 1,232
14년 전 조회 1,260
14년 전 조회 1,538
14년 전 조회 1,521
14년 전 조회 1,768
14년 전 조회 1,407
14년 전 조회 1,323
14년 전 조회 1,233
14년 전 조회 1,165
14년 전 조회 1,188
14년 전 조회 1,353
14년 전 조회 2,566
14년 전 조회 1,240
14년 전 조회 1,557
14년 전 조회 2,719
14년 전 조회 1,827
14년 전 조회 1,569
14년 전 조회 5,310
14년 전 조회 2,525
14년 전 조회 1,358
14년 전 조회 1,251
14년 전 조회 1,198
14년 전 조회 1,115
14년 전 조회 2,390
14년 전 조회 3,709
14년 전 조회 1,191
14년 전 조회 1,395
14년 전 조회 2,371
14년 전 조회 1,225
14년 전 조회 1,867
14년 전 조회 2,210
14년 전 조회 1.1만
14년 전 조회 1,743