t

Loading Panel Widget

· 2011-11-01 (화) 17:47:24 · 3245

                                     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();
    }
};


댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,187건
+
제목 글쓴이 날짜 조회
11-11-16 조회 3,547
11-11-15 조회 2,663
11-11-15 조회 3,298
11-11-15 조회 2,749
11-11-14 조회 2,847
11-11-14 조회 3,798
11-11-14 조회 3,603
11-11-14 조회 4,286
11-11-14 조회 2,878
11-11-14 조회 2,779
11-11-13 조회 4,069
11-11-12 조회 2,705
11-11-12 조회 2,835
11-11-12 조회 4,063
11-11-11 조회 2,968
11-11-11 조회 2,911
11-11-11 조회 2,583
11-11-11 조회 2,903
11-11-11 조회 4,048
11-11-11 조회 2,511
11-11-11 조회 4,754
11-11-11 조회 2,780
11-11-11 조회 2,599
11-11-11 조회 2,465
11-11-11 조회 2,880
11-11-11 조회 2,658
11-11-11 조회 2,659
11-11-10 조회 3,107
11-11-10 조회 2,569
11-11-10 조회 3,200
11-11-10 조회 3,764
11-11-10 조회 2,457
11-11-10 조회 2,591
11-11-10 조회 2,420
11-11-09 조회 2,626
11-11-09 조회 3,350
11-11-09 조회 2,826
11-11-09 조회 2,968
11-11-08 조회 2,723
11-11-08 조회 3,057
11-11-08 조회 2,381
11-11-08 조회 3,340
11-11-08 조회 2,629
11-11-08 조회 3,408
11-11-06 조회 1만
11-11-06 조회 2,697
11-11-06 조회 3,698
11-11-06 조회 3,501
11-11-06 조회 3,805
11-11-06 조회 3,990
11-11-05 조회 2,533
11-11-05 조회 2,697
11-11-04 조회 8,593
11-11-04 조회 2,643
11-11-04 조회 2,701
11-11-04 조회 3,711
11-11-04 조회 2,600
11-11-04 조회 2,775
11-11-03 조회 4,040
11-11-03 조회 2,718
11-11-03 조회 5,685
11-11-02 조회 5,957
11-11-01 조회 3,246
11-11-01 조회 2,693
11-11-01 조회 3,307
11-11-01 조회 2,591
11-11-01 조회 2,929
11-11-01 조회 2,449
11-11-01 조회 9,465
11-11-01 조회 3,017
11-10-31 조회 2,396
11-10-27 조회 2,656
11-10-26 조회 3,244
11-10-26 조회 2,739
11-10-26 조회 2,592
11-10-26 조회 2,618
11-10-26 조회 2,505
11-10-25 조회 2,569
11-10-25 조회 2,672
11-10-25 조회 2,611
11-10-25 조회 2,594
11-10-24 조회 2,621
11-10-24 조회 2,908
11-10-24 조회 2,918
11-10-23 조회 3,291
11-10-23 조회 2,877
11-10-23 조회 2,779
11-10-21 조회 2,622
11-10-21 조회 2,545
11-10-21 조회 2,536
11-10-21 조회 2,931
11-10-20 조회 4,087
11-10-19 조회 2,589
11-10-19 조회 3,002
11-10-19 조회 4,117
11-10-19 조회 3,274
11-10-19 조회 2,978
11-10-19 조회 6,803
11-10-18 조회 4,138
11-10-18 조회 2,685