t

Loading Panel Widget

· 14년 전 · 1677

                                     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,591
14년 전 조회 1,530
14년 전 조회 1,519
14년 전 조회 1,235
14년 전 조회 1,496
14년 전 조회 2,497
14년 전 조회 1,053
14년 전 조회 3,058
14년 전 조회 1,369
14년 전 조회 1,093
14년 전 조회 1,059
14년 전 조회 1,351
14년 전 조회 1,265
14년 전 조회 1,166
14년 전 조회 1,658
14년 전 조회 1,088
14년 전 조회 1,728
14년 전 조회 2,138
14년 전 조회 1,086
14년 전 조회 1,196
14년 전 조회 1,045
14년 전 조회 1,218
14년 전 조회 1,628
14년 전 조회 1,334
14년 전 조회 1,472
14년 전 조회 1,267
14년 전 조회 1,456
14년 전 조회 1,022
14년 전 조회 1,858
14년 전 조회 1,202
14년 전 조회 1,977
14년 전 조회 8,744
14년 전 조회 1,311
14년 전 조회 2,138
14년 전 조회 1,923
14년 전 조회 2,184
14년 전 조회 2,537
14년 전 조회 1,111
14년 전 조회 1,252
14년 전 조회 7,050
14년 전 조회 1,222
14년 전 조회 1,123
14년 전 조회 2,332
14년 전 조회 1,217
14년 전 조회 1,186
14년 전 조회 2,677
14년 전 조회 1,265
14년 전 조회 4,220
14년 전 조회 4,354
14년 전 조회 1,678
14년 전 조회 1,249
14년 전 조회 1,897
14년 전 조회 1,179
14년 전 조회 1,472
14년 전 조회 1,062
14년 전 조회 7,962
14년 전 조회 1,603
14년 전 조회 1,001
14년 전 조회 1,167
14년 전 조회 1,857
14년 전 조회 1,317
14년 전 조회 1,148
14년 전 조회 1,234
14년 전 조회 1,189
14년 전 조회 1,046
14년 전 조회 1,179
14년 전 조회 1,147
14년 전 조회 1,171
14년 전 조회 1,188
14년 전 조회 1,471
14년 전 조회 1,461
14년 전 조회 1,710
14년 전 조회 1,348
14년 전 조회 1,259
14년 전 조회 1,173
14년 전 조회 1,105
14년 전 조회 1,120
14년 전 조회 1,294
14년 전 조회 2,501
14년 전 조회 1,178
14년 전 조회 1,497
14년 전 조회 2,656
14년 전 조회 1,756
14년 전 조회 1,506
14년 전 조회 5,245
14년 전 조회 2,460
14년 전 조회 1,302
14년 전 조회 1,184
14년 전 조회 1,122
14년 전 조회 1,048
14년 전 조회 2,319
14년 전 조회 3,640
14년 전 조회 1,131
14년 전 조회 1,335
14년 전 조회 2,304
14년 전 조회 1,143
14년 전 조회 1,803
14년 전 조회 2,155
14년 전 조회 1.1만
14년 전 조회 1,681