t

Loading Panel Widget

· 14년 전 · 1119

                                     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,029
14년 전 조회 935
14년 전 조회 685
14년 전 조회 926
14년 전 조회 1,941
14년 전 조회 507
14년 전 조회 2,468
14년 전 조회 841
14년 전 조회 544
14년 전 조회 549
14년 전 조회 814
14년 전 조회 718
14년 전 조회 618
14년 전 조회 1,102
14년 전 조회 542
14년 전 조회 1,218
14년 전 조회 1,586
14년 전 조회 552
14년 전 조회 684
14년 전 조회 530
14년 전 조회 680
14년 전 조회 1,120
14년 전 조회 811
14년 전 조회 925
14년 전 조회 750
14년 전 조회 897
14년 전 조회 485
14년 전 조회 1,299
14년 전 조회 652
14년 전 조회 1,404
14년 전 조회 8,151
14년 전 조회 785
14년 전 조회 1,622
14년 전 조회 1,344
14년 전 조회 1,622
14년 전 조회 1,963
14년 전 조회 559
14년 전 조회 704
14년 전 조회 6,492
14년 전 조회 682
14년 전 조회 619
14년 전 조회 1,773
14년 전 조회 669
14년 전 조회 670
14년 전 조회 2,136
14년 전 조회 736
14년 전 조회 3,646
14년 전 조회 3,764
14년 전 조회 1,120
14년 전 조회 709
14년 전 조회 1,386
14년 전 조회 638
14년 전 조회 959
14년 전 조회 543
14년 전 조회 7,362
14년 전 조회 1,046
14년 전 조회 460
14년 전 조회 616
14년 전 조회 1,327
14년 전 조회 759
14년 전 조회 595
14년 전 조회 716
14년 전 조회 645
14년 전 조회 453
14년 전 조회 622
14년 전 조회 608
14년 전 조회 591
14년 전 조회 654
14년 전 조회 900
14년 전 조회 914
14년 전 조회 1,146
14년 전 조회 805
14년 전 조회 720
14년 전 조회 599
14년 전 조회 566
14년 전 조회 558
14년 전 조회 731
14년 전 조회 1,957
14년 전 조회 612
14년 전 조회 925
14년 전 조회 2,098
14년 전 조회 1,197
14년 전 조회 971
14년 전 조회 4,708
14년 전 조회 1,918
14년 전 조회 777
14년 전 조회 646
14년 전 조회 602
14년 전 조회 496
14년 전 조회 1,764
14년 전 조회 3,092
14년 전 조회 585
14년 전 조회 779
14년 전 조회 1,750
14년 전 조회 619
14년 전 조회 1,279
14년 전 조회 1,615
14년 전 조회 1만
14년 전 조회 1,148
🐛 버그신고