js弹出窗口之弹出层的小例子
2013-06-17 00:00
381 查看
[html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <HTML xmlns="http://www.w3.org/1999/xhtml"> <HEAD> <TITLE>弹出窗口</TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <style> #popupcontent{ position: absolute; visibility: hidden; overflow: hidden; border:1px solid #CCC; background-color:#F9F9F9; border:1px solid #333; padding:5px;} </style> <script> var baseText = null; function showPopup(w,h){ var popUp = document.getElementById("popupcontent"); popUp.style.top = "200px"; popUp.style.left = "200px"; popUp.style.width = w + "px"; popUp.style.height = h + "px"; if (baseText == null) baseText = popUp.innerHTML; popUp.innerHTML = baseText + "<div id=\"statusbar\"><input type=\"button\" value=\"Close window\" onClick=\"hidePopup();\"></div>"; var sbar = document.getElementById("statusbar"); sbar.style.marginTop = (parseInt(h)-60) + "px"; popUp.style.visibility = "visible"; } function hidePopup(){ var popUp = document.getElementById("popupcontent"); popUp.style.visibility = "hidden"; } </script> <META content="MSHTML 6.00.2900.2838" name=GENERATOR></HEAD> <BODY> <div id="popupcontent">content</div> <p><a href="#" onClick="showPopup(300,200);" >onclick</a></p> </BODY> </HTML>
相关文章推荐
- js弹出窗口之弹出层的小例子
- js实现弹出窗口、页面变成灰色并不可操作的例子分享
- js实现弹出窗口、页面变成灰色并不可操作的例子分享
- js实现弹出窗口、页面变成灰色并不可操作的例子分享
- artDialog包---html和js完成弹出窗口和跳转
- 弹出窗口大全(js)
- JS&RE 控制图片显示大小, 弹出窗口自适应大小,自居中, 结合UBB与正则使用 By Stabx
- js弹出窗口居中显示
- js 弹出窗口居中
- js 弹出div窗口 可移动 可关闭
- js弹出窗口总结6种弹窗方法
- js弹出窗口总结6种弹窗方法
- js实现点击按钮弹出上传文件的窗口
- vue.js 利用组件之间通讯,写一个弹出框例子
- JS控制弹出窗口
- js弹出窗口详解
- .NET, MVC框架下利用html, CSS,js实现弹出窗口
- js弹出窗口大全
- js弹出窗口详解
- js多级树形弹出一个小窗口层(非常好用)实例代码