t

Loading Panel Widget

· 14년 전 · 1131

                                     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,034
14년 전 조회 1,046
14년 전 조회 955
14년 전 조회 704
14년 전 조회 951
14년 전 조회 1,959
14년 전 조회 527
14년 전 조회 2,490
14년 전 조회 861
14년 전 조회 558
14년 전 조회 568
14년 전 조회 830
14년 전 조회 739
14년 전 조회 635
14년 전 조회 1,119
14년 전 조회 559
14년 전 조회 1,236
14년 전 조회 1,599
14년 전 조회 571
14년 전 조회 703
14년 전 조회 546
14년 전 조회 701
14년 전 조회 1,137
14년 전 조회 825
14년 전 조회 942
14년 전 조회 764
14년 전 조회 916
14년 전 조회 508
14년 전 조회 1,320
14년 전 조회 672
14년 전 조회 1,421
14년 전 조회 8,165
14년 전 조회 800
14년 전 조회 1,635
14년 전 조회 1,356
14년 전 조회 1,640
14년 전 조회 1,974
14년 전 조회 577
14년 전 조회 719
14년 전 조회 6,505
14년 전 조회 698
14년 전 조회 637
14년 전 조회 1,787
14년 전 조회 694
14년 전 조회 686
14년 전 조회 2,153
14년 전 조회 757
14년 전 조회 3,656
14년 전 조회 3,777
14년 전 조회 1,132
14년 전 조회 726
14년 전 조회 1,403
14년 전 조회 649
14년 전 조회 975
14년 전 조회 558
14년 전 조회 7,382
14년 전 조회 1,057
14년 전 조회 478
14년 전 조회 629
14년 전 조회 1,338
14년 전 조회 770
14년 전 조회 610
14년 전 조회 733
14년 전 조회 658
14년 전 조회 468
14년 전 조회 640
14년 전 조회 625
14년 전 조회 606
14년 전 조회 669
14년 전 조회 917
14년 전 조회 928
14년 전 조회 1,156
14년 전 조회 813
14년 전 조회 741
14년 전 조회 616
14년 전 조회 578
14년 전 조회 573
14년 전 조회 739
14년 전 조회 1,970
14년 전 조회 627
14년 전 조회 939
14년 전 조회 2,115
14년 전 조회 1,216
14년 전 조회 985
14년 전 조회 4,720
14년 전 조회 1,930
14년 전 조회 791
14년 전 조회 662
14년 전 조회 619
14년 전 조회 509
14년 전 조회 1,774
14년 전 조회 3,102
14년 전 조회 599
14년 전 조회 788
14년 전 조회 1,763
14년 전 조회 632
14년 전 조회 1,291
14년 전 조회 1,633
14년 전 조회 1만
14년 전 조회 1,158
🐛 버그신고