想在页面中心弹出一个DIV_html/css_WEB-ITnose

WBOY
Freigeben: 2016-06-24 12:26:00
Original
1363 Leute haben es durchsucht

在学校只专心的学敲代码,所以前台页面的设计能力几乎为零。我想在单击一个button按钮时弹出个div。  可移动可关闭,请问有知道怎么实现的吗 谢谢。


回复讨论(解决方案)

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>提示信息框</title><style type="text/css">a{ color:#000; font-size:12px;text-decoration:none}a:hover{ color:#900; text-decoration:underline}body{background:;filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=#003366); overflow:hidden}#massage_box{ position:absolute; left:expression((body.clientWidth-350)/2); top:expression((body.clientHeight-200)/2); width:350px; height:200px;filter:dropshadow(color=#666666,offx=3,offy=3,positive=2); z-index:2; visibility:hidden}#mask{ position:absolute; top:0; left:0; width:expression(body.scrollWidth); height:expression(body.scrollHeight); background:#666; filter:ALPHA(opacity=60); z-index:1; visibility:hidden}.massage{border:#036 solid; border-width:1 1 3 1; width:95%; height:95%; background:#fff; color:#036; font-size:12px; line-height:150%}.header{background:#036; height:10%; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:3 5 0 5; color:#fff}</style><!--实现层移动--><script language="javascript">var Obj=''document.onmouseup=MUpdocument.onmousemove=MMovefunction MDown(Object){Obj=Object.iddocument.all(Obj).setCapture()pX=event.x-document.all(Obj).style.pixelLeft;pY=event.y-document.all(Obj).style.pixelTop;}function MMove(){if(Obj!=''){  document.all(Obj).style.left=event.x-pX;  document.all(Obj).style.top=event.y-pY;  }}function MUp(){if(Obj!=''){  document.all(Obj).releaseCapture();  Obj='';  }}</script></head><body><div id="massage_box"><div class="massage"><div class="header" onmousedown=MDown(massage_box)><div style="display:inline; width:150px; position:absolute">本站提示信息</div><span onClick="massage_box.style.visibility='hidden'; mask.style.visibility='hidden'" style="float:right; display:inline; cursor:hand">&times;</span></div><ul style="margin-right:25"><li>本人申明此博客所有文章(包括文章插图)均为原创,如需引用或转载请注明出处。 </li><li>欢迎大家对博文中观点留言评述,谢绝无聊人士无素质无观点的灌水漫骂。</li><li>本站已设背景音乐,听音乐盒中收集的音乐时请先到页面底部关闭背景音乐。</li></ul></div></div><div id="mask"></div><span onClick="mask.style.visibility='visible';massage_box.style.visibility='visible'" style="cursor:hand"><a href="#">显示提示信息</a></span><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></body></html>
Nach dem Login kopieren

其实楼主说的是模态插件,网上搜一搜,多得很……

ymPrompt.js
http://www.gcooler.com/uploadfile/favorites/demo/ymPrompt/demo.html
有说明文档,一直用这个,觉得还行,你可以试试~~

插件轻松搞定 ||
点击按钮后添加节点,用绝对定位,z-index设置大些,填充内容 ||
html文档中提前写好一个这个弹窗,display设置none,点击按钮后display设置为block

一般框架都会自带这些功能的你找找看。

Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!