<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> <img src="https://www.jb51.net/index/images/fdTel.gif" usemap="#Maps"> <map> <area shape="rect" coords="2,2,79,52"> <area shape="rect" coords="77,2,166,52" href="https://www.jb51.net/tel:0855-8253310"> <area shape="rect" coords="166,4,242,51"> <area shape="rect" coords="248,5,318,53"> </map> </div> <div> <a href="###"><img src="https://www.jb51.net/index/images/closeBtn.png"></a> <a href="###"></a> <a href="###"></a> </div>
js:
// JavaScript Document document.writeln("<style type=https://www.jb51.net/article/\"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=https://www.jb51.net/article/\"fdBonTel\">"); document.writeln(" <img src=https://www.jb51.net/article/\"index/images/fdTel.gif\" usemap=https://www.jb51.net/article/\"#Maps\">"); document.writeln(" <map name=https://www.jb51.net/article/\"Maps\" id=https://www.jb51.net/article/\"Maps\">"); document.writeln(" <area shape=https://www.jb51.net/article/\"rect\" coords=https://www.jb51.net/article/\"2,2,79,52\" onClick=https://www.jb51.net/article/\"openZoosUrl();\">"); document.writeln(" <area shape=https://www.jb51.net/article/\"rect\" coords=https://www.jb51.net/article/\"77,2,166,52\" href=https://www.jb51.net/article/\"tel:0855-8253310\">"); document.writeln(" <area shape=https://www.jb51.net/article/\"rect\" coords=https://www.jb51.net/article/\"166,4,242,51\" onClick=https://www.jb51.net/article/\"openZoosUrl();\">"); document.writeln(" <area shape=https://www.jb51.net/article/\"rect\" coords=https://www.jb51.net/article/\"248,5,318,53\" onClick=https://www.jb51.net/article/\"openZoosUrl();\">"); document.writeln(" </map>"); document.writeln("</div>"); document.writeln("<div class=https://www.jb51.net/article/\"fdOnline\" id=https://www.jb51.net/article/\"fdOnline\">"); document.writeln(" <a href=https://www.jb51.net/article/\"###\" class=https://www.jb51.net/article/\"fdOClose f_r\" onclick=https://www.jb51.net/article/\"closeOnline();\"><img src=https://www.jb51.net/article/\"index/images/closeBtn.png\" width=https://www.jb51.net/article/\"44\" height=https://www.jb51.net/article/\"44\"></a>"); document.writeln(" <a href=https://www.jb51.net/article/\"###\" class=https://www.jb51.net/article/\"fdOTel f_l\"></a>"); document.writeln(" <a href=https://www.jb51.net/article/\"###\" class=https://www.jb51.net/article/\"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数学运算用法总结》