t

Loading Panel Widget

· 14년 전 · 1566

                                     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,522
14년 전 조회 1,422
14년 전 조회 1,407
14년 전 조회 1,112
14년 전 조회 1,378
14년 전 조회 2,397
14년 전 조회 948
14년 전 조회 2,949
14년 전 조회 1,265
14년 전 조회 985
14년 전 조회 950
14년 전 조회 1,234
14년 전 조회 1,150
14년 전 조회 1,062
14년 전 조회 1,539
14년 전 조회 977
14년 전 조회 1,612
14년 전 조회 2,021
14년 전 조회 962
14년 전 조회 1,092
14년 전 조회 925
14년 전 조회 1,096
14년 전 조회 1,518
14년 전 조회 1,221
14년 전 조회 1,362
14년 전 조회 1,160
14년 전 조회 1,346
14년 전 조회 910
14년 전 조회 1,738
14년 전 조회 1,094
14년 전 조회 1,914
14년 전 조회 8,668
14년 전 조회 1,206
14년 전 조회 2,029
14년 전 조회 1,802
14년 전 조회 2,063
14년 전 조회 2,471
14년 전 조회 999
14년 전 조회 1,137
14년 전 조회 6,920
14년 전 조회 1,099
14년 전 조회 1,022
14년 전 조회 2,206
14년 전 조회 1,098
14년 전 조회 1,067
14년 전 조회 2,570
14년 전 조회 1,156
14년 전 조회 4,155
14년 전 조회 4,290
14년 전 조회 1,567
14년 전 조회 1,136
14년 전 조회 1,790
14년 전 조회 1,068
14년 전 조회 1,359
14년 전 조회 956
14년 전 조회 7,884
14년 전 조회 1,494
14년 전 조회 881
14년 전 조회 1,050
14년 전 조회 1,737
14년 전 조회 1,195
14년 전 조회 1,033
14년 전 조회 1,122
14년 전 조회 1,074
14년 전 조회 928
14년 전 조회 1,065
14년 전 조회 1,041
14년 전 조회 1,045
14년 전 조회 1,068
14년 전 조회 1,358
14년 전 조회 1,350
14년 전 조회 1,588
14년 전 조회 1,249
14년 전 조회 1,151
14년 전 조회 1,080
14년 전 조회 1,006
14년 전 조회 1,010
14년 전 조회 1,180
14년 전 조회 2,404
14년 전 조회 1,063
14년 전 조회 1,430
14년 전 조회 2,549
14년 전 조회 1,644
14년 전 조회 1,401
14년 전 조회 5,140
14년 전 조회 2,348
14년 전 조회 1,202
14년 전 조회 1,068
14년 전 조회 1,018
14년 전 조회 943
14년 전 조회 2,210
14년 전 조회 3,531
14년 전 조회 1,015
14년 전 조회 1,270
14년 전 조회 2,200
14년 전 조회 1,042
14년 전 조회 1,696
14년 전 조회 2,048
14년 전 조회 1.1만
14년 전 조회 1,566