t

Loading Panel Widget

· 14년 전 · 1121

                                     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,020
14년 전 조회 1,032
14년 전 조회 941
14년 전 조회 691
14년 전 조회 931
14년 전 조회 1,947
14년 전 조회 515
14년 전 조회 2,473
14년 전 조회 848
14년 전 조회 549
14년 전 조회 553
14년 전 조회 820
14년 전 조회 725
14년 전 조회 621
14년 전 조회 1,108
14년 전 조회 546
14년 전 조회 1,220
14년 전 조회 1,589
14년 전 조회 557
14년 전 조회 689
14년 전 조회 534
14년 전 조회 684
14년 전 조회 1,123
14년 전 조회 815
14년 전 조회 928
14년 전 조회 754
14년 전 조회 906
14년 전 조회 489
14년 전 조회 1,302
14년 전 조회 653
14년 전 조회 1,406
14년 전 조회 8,153
14년 전 조회 789
14년 전 조회 1,626
14년 전 조회 1,346
14년 전 조회 1,627
14년 전 조회 1,965
14년 전 조회 564
14년 전 조회 706
14년 전 조회 6,496
14년 전 조회 685
14년 전 조회 623
14년 전 조회 1,776
14년 전 조회 676
14년 전 조회 673
14년 전 조회 2,140
14년 전 조회 740
14년 전 조회 3,647
14년 전 조회 3,768
14년 전 조회 1,122
14년 전 조회 711
14년 전 조회 1,389
14년 전 조회 640
14년 전 조회 963
14년 전 조회 544
14년 전 조회 7,369
14년 전 조회 1,048
14년 전 조회 462
14년 전 조회 616
14년 전 조회 1,331
14년 전 조회 761
14년 전 조회 599
14년 전 조회 721
14년 전 조회 647
14년 전 조회 458
14년 전 조회 625
14년 전 조회 613
14년 전 조회 593
14년 전 조회 658
14년 전 조회 905
14년 전 조회 917
14년 전 조회 1,147
14년 전 조회 807
14년 전 조회 723
14년 전 조회 601
14년 전 조회 570
14년 전 조회 563
14년 전 조회 734
14년 전 조회 1,962
14년 전 조회 617
14년 전 조회 927
14년 전 조회 2,101
14년 전 조회 1,200
14년 전 조회 973
14년 전 조회 4,709
14년 전 조회 1,922
14년 전 조회 781
14년 전 조회 651
14년 전 조회 603
14년 전 조회 497
14년 전 조회 1,766
14년 전 조회 3,097
14년 전 조회 586
14년 전 조회 780
14년 전 조회 1,754
14년 전 조회 621
14년 전 조회 1,280
14년 전 조회 1,619
14년 전 조회 1만
14년 전 조회 1,149
🐛 버그신고