当前位置:   article > 正文

TinyBox列子

tinybox
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  5. <title>酷酷的弹出层</title>
  6. <style type="text/css">
  7. body{background:#eeeeee; font-size:63%;}
  8. .box{width:70%; padding:30px; margin:0 auto; background:#ffffff; border:1px solid #cccccc;}
  9. h3{font:bold 1.6em/2em "宋体";}
  10. .title{padding:0.8em 0 0.8em 1em; background:#eeeeee; border:1px solid #d0d0d0; font-size:1.4em; font-weight:bold; margin:20px auto 15px;}
  11. .content{margin:0; line-height:1.5; font-size:1.2em;}
  12. .a_blue{color:#0066CC; font-size:0.9em; font-weight:normal; margin-left:30px;}
  13. .a_blue:hover{color:#009999; text-decoration:none;}
  14. #tinybox{position:absolute; display:none; padding:10px; background:#ffffff url(image/preload.gif) no-repeat 50% 50%; border:10px solid #e3e3e3; z-index:2000}
  15. #tinymask{position:absolute; display:none; top:0; left:0; height:100%; width:100%; background:#000000; z-index:1500}
  16. #tinycontent{background:#ffffff; font-size:1.2em;}
  17. </style>
  18. <script type="text/javascript" src="js/tinybox.js"></script>
  19. </head>
  20. <body>
  21. <div class="box">
  22. <h3>酷酷的弹出层</h3>
  23. <div class="title">加载一个静态页面<a class="a_blue" href="#zhangxinxu" id="click_test1">效果预览</a></div>
  24. <div class="content">加载一个静态页面,这里可能无法测试出来,在服务器项目里可以看见效果</div>
  25. <div class="title">图片<a class="a_blue" href="#zhangxinxu" id="click_test2">效果预览</a></div>
  26. <div class="content">用酷酷的浮动层显示图片</div>
  27. <div class="title">自动隐藏<a class="a_blue" href="#zhangxinxu" id="click_test3">效果预览</a></div>
  28. <div class="content">层显示一段时间后自动隐藏,当作提示用是个很不错的选择</div>
  29. </div>
  30. <script type="text/javascript">
  31. T$('click_test1').onclick = function(){TINY.box.show('word-mix-widh-auto-btn.html',1,300,150,1)}
  32. var content2 = "<img width='600' height='480' src='http://lh3.ggpht.com/_ZR4fYJ5mtLI/SjJ5bx9BsUI/AAAAAAAAABU/LRHBRkU1wdA/s512/PICX.jpg' border='0' />";
  33. T$('click_test2').onclick = function(){TINY.box.show(content2,0,0,0,1)}
  34. var content3 = "该浮动层将在3秒钟内消失。";
  35. T$('click_test3').onclick = function(){TINY.box.show(content3,0,0,0,0,3)}
  36. </script>
  37. </body>
  38. </html>

 

 

调用一个名为tinybox的js就ok啦。其他用法见示例代码了。

页面效果预览

js文件下载

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/572605
推荐阅读