t

Loading Panel Widget

· 14년 전 · 1118

                                     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,015
14년 전 조회 1,024
14년 전 조회 934
14년 전 조회 679
14년 전 조회 926
14년 전 조회 1,938
14년 전 조회 506
14년 전 조회 2,465
14년 전 조회 839
14년 전 조회 541
14년 전 조회 543
14년 전 조회 809
14년 전 조회 716
14년 전 조회 615
14년 전 조회 1,101
14년 전 조회 537
14년 전 조회 1,217
14년 전 조회 1,584
14년 전 조회 549
14년 전 조회 683
14년 전 조회 528
14년 전 조회 679
14년 전 조회 1,113
14년 전 조회 808
14년 전 조회 925
14년 전 조회 750
14년 전 조회 896
14년 전 조회 484
14년 전 조회 1,298
14년 전 조회 649
14년 전 조회 1,403
14년 전 조회 8,147
14년 전 조회 782
14년 전 조회 1,617
14년 전 조회 1,343
14년 전 조회 1,620
14년 전 조회 1,959
14년 전 조회 556
14년 전 조회 700
14년 전 조회 6,490
14년 전 조회 677
14년 전 조회 616
14년 전 조회 1,769
14년 전 조회 668
14년 전 조회 669
14년 전 조회 2,134
14년 전 조회 734
14년 전 조회 3,644
14년 전 조회 3,764
14년 전 조회 1,119
14년 전 조회 708
14년 전 조회 1,383
14년 전 조회 635
14년 전 조회 958
14년 전 조회 541
14년 전 조회 7,360
14년 전 조회 1,045
14년 전 조회 456
14년 전 조회 616
14년 전 조회 1,325
14년 전 조회 757
14년 전 조회 593
14년 전 조회 713
14년 전 조회 644
14년 전 조회 451
14년 전 조회 619
14년 전 조회 606
14년 전 조회 588
14년 전 조회 652
14년 전 조회 895
14년 전 조회 912
14년 전 조회 1,143
14년 전 조회 802
14년 전 조회 719
14년 전 조회 599
14년 전 조회 566
14년 전 조회 557
14년 전 조회 730
14년 전 조회 1,955
14년 전 조회 610
14년 전 조회 924
14년 전 조회 2,096
14년 전 조회 1,196
14년 전 조회 969
14년 전 조회 4,707
14년 전 조회 1,917
14년 전 조회 774
14년 전 조회 642
14년 전 조회 601
14년 전 조회 494
14년 전 조회 1,762
14년 전 조회 3,085
14년 전 조회 584
14년 전 조회 774
14년 전 조회 1,749
14년 전 조회 619
14년 전 조회 1,278
14년 전 조회 1,613
14년 전 조회 1만
14년 전 조회 1,145
🐛 버그신고