t

Loading Panel Widget

· 14년 전 · 1106

                                     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년 전 조회 1,991
14년 전 조회 1,007
14년 전 조회 918
14년 전 조회 663
14년 전 조회 908
14년 전 조회 1,921
14년 전 조회 492
14년 전 조회 2,449
14년 전 조회 817
14년 전 조회 527
14년 전 조회 526
14년 전 조회 793
14년 전 조회 697
14년 전 조회 595
14년 전 조회 1,085
14년 전 조회 519
14년 전 조회 1,200
14년 전 조회 1,570
14년 전 조회 534
14년 전 조회 663
14년 전 조회 516
14년 전 조회 665
14년 전 조회 1,095
14년 전 조회 791
14년 전 조회 913
14년 전 조회 736
14년 전 조회 880
14년 전 조회 470
14년 전 조회 1,281
14년 전 조회 628
14년 전 조회 1,384
14년 전 조회 8,138
14년 전 조회 761
14년 전 조회 1,606
14년 전 조회 1,329
14년 전 조회 1,602
14년 전 조회 1,939
14년 전 조회 539
14년 전 조회 682
14년 전 조회 6,473
14년 전 조회 665
14년 전 조회 600
14년 전 조회 1,749
14년 전 조회 653
14년 전 조회 650
14년 전 조회 2,118
14년 전 조회 715
14년 전 조회 3,626
14년 전 조회 3,751
14년 전 조회 1,107
14년 전 조회 691
14년 전 조회 1,368
14년 전 조회 615
14년 전 조회 940
14년 전 조회 527
14년 전 조회 7,346
14년 전 조회 1,031
14년 전 조회 442
14년 전 조회 602
14년 전 조회 1,309
14년 전 조회 742
14년 전 조회 574
14년 전 조회 695
14년 전 조회 629
14년 전 조회 435
14년 전 조회 599
14년 전 조회 585
14년 전 조회 569
14년 전 조회 639
14년 전 조회 883
14년 전 조회 897
14년 전 조회 1,126
14년 전 조회 784
14년 전 조회 707
14년 전 조회 584
14년 전 조회 554
14년 전 조회 543
14년 전 조회 720
14년 전 조회 1,937
14년 전 조회 596
14년 전 조회 913
14년 전 조회 2,081
14년 전 조회 1,185
14년 전 조회 957
14년 전 조회 4,698
14년 전 조회 1,898
14년 전 조회 758
14년 전 조회 631
14년 전 조회 590
14년 전 조회 478
14년 전 조회 1,748
14년 전 조회 3,074
14년 전 조회 569
14년 전 조회 760
14년 전 조회 1,741
14년 전 조회 603
14년 전 조회 1,261
14년 전 조회 1,602
14년 전 조회 1만
14년 전 조회 1,130
🐛 버그신고