t

Loading Panel Widget

· 14년 전 · 1116

                                     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,012
14년 전 조회 1,018
14년 전 조회 928
14년 전 조회 675
14년 전 조회 923
14년 전 조회 1,937
14년 전 조회 504
14년 전 조회 2,462
14년 전 조회 837
14년 전 조회 540
14년 전 조회 539
14년 전 조회 806
14년 전 조회 715
14년 전 조회 611
14년 전 조회 1,098
14년 전 조회 536
14년 전 조회 1,215
14년 전 조회 1,579
14년 전 조회 546
14년 전 조회 677
14년 전 조회 526
14년 전 조회 675
14년 전 조회 1,108
14년 전 조회 804
14년 전 조회 924
14년 전 조회 748
14년 전 조회 896
14년 전 조회 483
14년 전 조회 1,293
14년 전 조회 646
14년 전 조회 1,398
14년 전 조회 8,146
14년 전 조회 779
14년 전 조회 1,616
14년 전 조회 1,340
14년 전 조회 1,618
14년 전 조회 1,956
14년 전 조회 555
14년 전 조회 696
14년 전 조회 6,487
14년 전 조회 674
14년 전 조회 615
14년 전 조회 1,766
14년 전 조회 666
14년 전 조회 665
14년 전 조회 2,132
14년 전 조회 732
14년 전 조회 3,639
14년 전 조회 3,762
14년 전 조회 1,117
14년 전 조회 704
14년 전 조회 1,380
14년 전 조회 632
14년 전 조회 951
14년 전 조회 538
14년 전 조회 7,357
14년 전 조회 1,043
14년 전 조회 454
14년 전 조회 615
14년 전 조회 1,318
14년 전 조회 756
14년 전 조회 590
14년 전 조회 710
14년 전 조회 638
14년 전 조회 449
14년 전 조회 617
14년 전 조회 601
14년 전 조회 586
14년 전 조회 650
14년 전 조회 895
14년 전 조회 909
14년 전 조회 1,139
14년 전 조회 798
14년 전 조회 715
14년 전 조회 596
14년 전 조회 566
14년 전 조회 552
14년 전 조회 729
14년 전 조회 1,950
14년 전 조회 608
14년 전 조회 921
14년 전 조회 2,094
14년 전 조회 1,194
14년 전 조회 969
14년 전 조회 4,705
14년 전 조회 1,916
14년 전 조회 773
14년 전 조회 640
14년 전 조회 599
14년 전 조회 493
14년 전 조회 1,762
14년 전 조회 3,085
14년 전 조회 580
14년 전 조회 770
14년 전 조회 1,749
14년 전 조회 614
14년 전 조회 1,273
14년 전 조회 1,610
14년 전 조회 1만
14년 전 조회 1,142
🐛 버그신고