t

Loading Panel Widget

· 14년 전 · 1559

                                     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,514
14년 전 조회 1,415
14년 전 조회 1,400
14년 전 조회 1,102
14년 전 조회 1,367
14년 전 조회 2,385
14년 전 조회 935
14년 전 조회 2,942
14년 전 조회 1,256
14년 전 조회 973
14년 전 조회 940
14년 전 조회 1,227
14년 전 조회 1,143
14년 전 조회 1,057
14년 전 조회 1,532
14년 전 조회 971
14년 전 조회 1,598
14년 전 조회 2,012
14년 전 조회 951
14년 전 조회 1,086
14년 전 조회 923
14년 전 조회 1,091
14년 전 조회 1,509
14년 전 조회 1,214
14년 전 조회 1,356
14년 전 조회 1,151
14년 전 조회 1,339
14년 전 조회 900
14년 전 조회 1,729
14년 전 조회 1,087
14년 전 조회 1,906
14년 전 조회 8,659
14년 전 조회 1,199
14년 전 조회 2,019
14년 전 조회 1,797
14년 전 조회 2,058
14년 전 조회 2,462
14년 전 조회 989
14년 전 조회 1,129
14년 전 조회 6,908
14년 전 조회 1,094
14년 전 조회 1,012
14년 전 조회 2,196
14년 전 조회 1,090
14년 전 조회 1,059
14년 전 조회 2,560
14년 전 조회 1,140
14년 전 조회 4,148
14년 전 조회 4,284
14년 전 조회 1,560
14년 전 조회 1,129
14년 전 조회 1,782
14년 전 조회 1,057
14년 전 조회 1,346
14년 전 조회 947
14년 전 조회 7,879
14년 전 조회 1,487
14년 전 조회 875
14년 전 조회 1,045
14년 전 조회 1,725
14년 전 조회 1,179
14년 전 조회 1,026
14년 전 조회 1,106
14년 전 조회 1,065
14년 전 조회 916
14년 전 조회 1,059
14년 전 조회 1,031
14년 전 조회 1,032
14년 전 조회 1,059
14년 전 조회 1,351
14년 전 조회 1,346
14년 전 조회 1,582
14년 전 조회 1,241
14년 전 조회 1,143
14년 전 조회 1,072
14년 전 조회 998
14년 전 조회 1,003
14년 전 조회 1,173
14년 전 조회 2,396
14년 전 조회 1,057
14년 전 조회 1,422
14년 전 조회 2,541
14년 전 조회 1,636
14년 전 조회 1,389
14년 전 조회 5,134
14년 전 조회 2,344
14년 전 조회 1,196
14년 전 조회 1,060
14년 전 조회 1,008
14년 전 조회 931
14년 전 조회 2,202
14년 전 조회 3,514
14년 전 조회 1,005
14년 전 조회 1,263
14년 전 조회 2,188
14년 전 조회 1,034
14년 전 조회 1,683
14년 전 조회 2,034
14년 전 조회 1.1만
14년 전 조회 1,559