用Mootools寫的一个类似facebook的弹出对话框
来源:互联网 发布:专业处理淘宝售假申诉 编辑:程序博客网 时间:2024/06/06 21:04
/*/mootools版本要求:mootools1.4以上調用并顯示普通內容的方法:Dilog({tit:'這是標題',htm:'這是內容<br>This should be big enough?'});調用框架頁面的方法:Dilog({tit:'這是標題',htm:'http://7di.net',iframe:'yes',cov:true});/*///核心代碼:var Dilog=function(o){ document.getElement('body').setStyle('overflow','hidden'); if(!o || !o.htm){ if($('xDialog')){$('xDialog').destroy();} if($('xCover')){$('xCover').destroy();} document.getElement('body').setStyle('overflow','auto'); return false; } if($('xDialog')){return ;}//如果已經打開了一個則不可再打開第二個 w=document.documentElement.clientWidth; o.tit=(o.tit) || '易居網'; //標題 o.wid=(o.wid) || '560px'; //寬度 o.hgt=(o.hgt) || '450px'; //高度 o.cov=(o.cov) || false; //是否遮罩 o.covcl=(o.covcl) || 'white'; //是否遮罩 o.btn=(typeOf(o.btn)=='boolean')?o.btn:true; //是否有關閉按鈕 o.lft=(o.lft) || ((w-(o.wid.toInt()))/3).toInt()+'px'; o.top=(o.obj)?o.obj.getPosition().y+'px':(parseInt(document.documentElement.scrollTop,10))+'px'; css='#xDialog{padding:8px;margin:0;z-index:1201;position:absolute;top:'+o.top+';background:transparent url(img/bg.png);border:0px solid #888;min-width:200px;}'; css+='#xDialog .box{border:1px solid #3B5998;background:white;}'; css+='#xDialog .title{background:#6D84B4;color:white;cursor:default;font-size:14px;font-weight:bold;letter-spacing:1px;line-height:30px;padding:1px 8px;height:30px;}#xDialog .title span{font-size:14px;}'; css+='#xDialog .message{line-height:20px;font-size:13px;color:#333;}'; css+='#xDialog .close{background:url("img/ico.gif") no-repeat scroll -134px -60px transparent;cursor:pointer;float:right;height:20px;width:20px;}'; if(o.cov){css+='#xCover{border:0;left:0;top:0;position:fixed;right:0;bottom:0;background:'+o.covcl+';z-index:1200;filter:Alpha(opacity=80);-moz-opacity:.8;opacity:0.8;}';} AddCss(css,'xDialog_css'); $xCover=new Element('div',{'id':'xCover','style':'display:block;'}).inject(document.body,'top'); $xDialog=new Element('div',{'id':'xDialog','style':'width:'+o.wid+';left:'+o.lft+';top:'+o.top+';visibility:visible;zoom:1;opacity:1;'}).inject(document.body,'top'); o.btn=(o.btn)?'<span class="close" title="Close Dialog" onclick="Dilog();"></span>':''; if(o.iframe=='yes'){ $xDialog.set('html','<div class="box"><div class="title"><span style="float:left;">'+o.tit+'</span>'+o.btn+'</div><div class="message" id="xDil_mess" style="height:auto;"><iframe src="'+o.htm+'" name="InfoFrame" scrolling="auto" width="100%" style="height:'+o.hgt+';" frameborder="0"></iframe></div></div>'); }else{ $xDialog.set('html','<div class="box"><div class="title"><span style="float:left;">'+o.tit+'</span>'+o.btn+'</div><div class="message" id="xDil_mess" style="height:auto;">'+o.htm+'</div></div>'); } o=null;};
0 0
- 用Mootools寫的一个类似facebook的弹出对话框
- 实现简单的类似Lightbox效果的弹出对话框
- 一个类似淘宝弹出框的示例
- 一个很棒的类似 Facebook 风格的 TextboxList
- Silverlight中实现类似MessageBox的弹出对话框
- Silverlight中怎么实现类似MessageBox的弹出对话框
- 请教一个关于弹出对话框的问题.
- 类似 QQ的对话框
- 推荐一个超人气的类似MSN弹出的控件
- 推荐一个超人气的类似MSN弹出的控件
- 关于mootools中的bind的一个测试
- 一个类似QQ弹出窗口的JQUERY插件
- 一个底部弹出Popwindow的效果(类似Ios)
- 实现自定义的dialog(类似QQ点击退出后弹出的对话框)
- 漂亮的弹出对话框
- 弹出对话框的实现
- 弹出对话框的函数
- .net的弹出对话框
- suddenly backBai Dao
- 用Mootools获得操作索引的两种方法
- Cordova(PhoneGap)体系结构(Android)
- 背景图跟随鼠标移动的Mootools插件
- that the proud day s
- 用Mootools寫的一个类似facebook的弹出对话框
- 众程序员你们为何在忙?
- php调用dll的实例操作动画
- that a few good not
- 百度,你真牛x
- 计算几何模板
- 需求沟通和实施
- The Prime Minister
- php5和php6的区别