本文实例讲述了JS实现简单易用的手机端浮动窗口显示效果。分享给大家供大家参考,具体如下:
html:
<style type="text/css"> .fdBonTel{ width:100%; height:53px; position:fixed; background:#0052ae; text-align:center; left:0; bottom:0; z-index:999; } .fdOnline{ background:url(index/images/online.png) no-repeat; width:255px; height:181px; position:fixed; left:50%; margin-left:-128px; top:40%; z-index:999; border-radius: 15px; box-shadow: 0 0 20px rgba(10, 2, 4, 0.75);} .fdOnline .fdOClose{ width:44px; height:44px; display:block; margin-top:-17px; margin-right:-6px;} .fdOnline .fdOTel{ background:#CF3; width:127px; height:58px; display:block; margin-top:123px;} .fdOnline .fdOOn{ background:#036; width:128px; height:58px; display:block; margin-top:96px;} </style> <div class="fdBonTel"> <img src="/UploadFiles/2021-04-02/fdTel.gif">js:
// JavaScript Document document.writeln("<style type=\"text/css\">"); document.writeln(".fdBonTel{ width:100%; height:53px; position:fixed; background:#0052ae; text-align:center; left:0; bottom:0; z-index:999; }"); document.writeln(".fdOnline{ background:url(index/images/online.png) no-repeat; width:255px; height:181px; position:fixed; left:50%; margin-left:-128px; top:40%; z-index:999; border-radius: 15px; box-shadow: 0 0 20px rgba(10, 2, 4, 0.75);}"); document.writeln(".fdOnline .fdOClose{ width:44px; height:44px; display:block; margin-top:-17px; margin-right:-6px;}"); document.writeln(".fdOnline .fdOTel{ width:127px; height:58px; display:block; margin-top:123px;}"); document.writeln(".fdOnline .fdOOn{ width:128px; height:58px; display:block; margin-top:96px;}"); document.writeln("</style>"); document.writeln("<div class=\"fdBonTel\">"); document.writeln(" <img src=\"index/images/fdTel.gif\" usemap=\"#Maps\">"); document.writeln(" <map name=\"Maps\" id=\"Maps\">"); document.writeln(" <area shape=\"rect\" coords=\"2,2,79,52\" onClick=\"openZoosUrl();\">"); document.writeln(" <area shape=\"rect\" coords=\"77,2,166,52\" href=\"tel:0855-8253310\">"); document.writeln(" <area shape=\"rect\" coords=\"166,4,242,51\" onClick=\"openZoosUrl();\">"); document.writeln(" <area shape=\"rect\" coords=\"248,5,318,53\" onClick=\"openZoosUrl();\">"); document.writeln(" </map>"); document.writeln("</div>"); document.writeln("<div class=\"fdOnline\" id=\"fdOnline\">"); document.writeln(" <a href=\"###\" class=\"fdOClose f_r\" onclick=\"closeOnline();\"><img src=\"index/images/closeBtn.png\" width=\"44\" height=\"44\"></a>"); document.writeln(" <a href=\"###\" class=\"fdOTel f_l\"></a>"); document.writeln(" <a href=\"###\" class=\"fdOOn f_r\"></a>"); document.writeln("</div>"); function showOnline() { if (document.getElementById("fdOnline")) { if (document.getElementById("fdOnline").style.display == "none") { document.getElementById("fdOnline").style.display = "block"; } } } function closeOnline() { document.getElementById("fdOnline").style.display = "none"; setInterval(chkSWT, 30000); }; $(function(){ setInterval(showOnline, 30000); });效果图:
更多关于JavaScript相关内容感兴趣的读者可查看本站专题:《JavaScript遍历算法与技巧总结》、《JavaScript切换特效与技巧总结》、《JavaScript查找算法技巧总结》、《JavaScript动画特效与技巧汇总》、《JavaScript错误与调试技巧总结》、《JavaScript数据结构与算法技巧总结》及《JavaScript数学运算用法总结》
希望本文所述对大家JavaScript程序设计有所帮助。
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
更新日志
2024年09月25日
2024年09月25日
- 林忆莲.2019-0(2023精装版)【环球】【WAV+CUE】
- Supper.Moment.2016-The.Moment【寰亚】【FLAC分轨】
- 范莉丝.1979-送郎一朵牵牛花(LP版)【大联机构】【WAV+CUE】
- 刘宇.2024-宇宙诗人【哔哟哔哟文化】【FLAC分轨】
- 《全景声白噪音》沉浸式大自然助眠 带你听自然的声音[mp3]
- 纯音入心系列纯音乐《古筝精选 十指弹一赏心曲一心奏出世人心》1CD[MP3][582MB]
- 纯音入心系列纯音乐《古筝与现代音乐的交织》1CD[MP3][96MB]
- 王俪婷.2011-ROMANCE【华研国际】【WAV+CUE】
- 狮子合唱团.2016-LION(引进版)【华纳】【WAV+CUE】
- 范文芳.1996-FNNTASY【HYPE】【WAV+CUE】
- 纯音入心系列纯音乐《韵味古筝曲》1CD[MP3][146.2MB]
- 纯音入心系列纯音乐《古筝系列-传统乐曲》1CD[MP3][974.7MB]
- 纯音入心系列纯音乐《古筝系列-弦凝指咽声停处》1CD[MP3][656.5MB]
- 群星.1994-大烂片2辑【派森】【WAV+CUE】
- 吴倩莲.1997-望爱【EMI百代】【WAV+CUE】