JS實(shí)現(xiàn)簡(jiǎn)單易用的手機(jī)端浮動(dòng)窗口顯示效果
本文實(shí)例講述了JS實(shí)現(xiàn)簡(jiǎn)單易用的手機(jī)端浮動(dòng)窗口顯示效果。分享給大家供大家參考,具體如下:
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="index/images/fdTel.gif" usemap="#Maps"> <map name="Maps" id="Maps"> <area shape="rect" coords="2,2,79,52" onClick="openZoosUrl();"> <area shape="rect" coords="77,2,166,52" href="tel:0855-8253310"> <area shape="rect" coords="166,4,242,51" onClick="openZoosUrl();"> <area shape="rect" coords="248,5,318,53" onClick="openZoosUrl();"> </map> </div> <div class="fdOnline" id="fdOnline"> <a href="###" class="fdOClose f_r" onclick="closeOnline();"><img src="index/images/closeBtn.png" width="44" height="44"></a> <a href="###" class="fdOTel f_l"></a> <a href="###" class="fdOOn f_r"></a> </div>
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); });
效果圖:
更多關(guān)于JavaScript相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《JavaScript遍歷算法與技巧總結(jié)》、《JavaScript切換特效與技巧總結(jié)》、《JavaScript查找算法技巧總結(jié)》、《JavaScript動(dòng)畫(huà)特效與技巧匯總》、《JavaScript錯(cuò)誤與調(diào)試技巧總結(jié)》、《JavaScript數(shù)據(jù)結(jié)構(gòu)與算法技巧總結(jié)》及《JavaScript數(shù)學(xué)運(yùn)算用法總結(jié)》
希望本文所述對(duì)大家JavaScript程序設(shè)計(jì)有所幫助。
- jQuery實(shí)現(xiàn)彈出帶遮罩層的居中浮動(dòng)窗口效果
- JS簡(jiǎn)單實(shí)現(xiàn)浮動(dòng)窗口效果示例
- JavaScript實(shí)現(xiàn)上下浮動(dòng)的窗口效果代碼
- jquery實(shí)現(xiàn)浮動(dòng)在網(wǎng)頁(yè)右下角的彩票開(kāi)獎(jiǎng)公告窗口代碼
- JS實(shí)現(xiàn)彈出浮動(dòng)窗口(支持鼠標(biāo)拖動(dòng)和關(guān)閉)實(shí)例詳解
- JS實(shí)現(xiàn)可縮放、拖動(dòng)、關(guān)閉和最小化的浮動(dòng)窗口完整實(shí)例
- jQuery之浮動(dòng)窗口實(shí)現(xiàn)代碼(兩種方法)
- 多瀏覽器支持的右下角浮動(dòng)窗口
- JQuery 實(shí)現(xiàn)的頁(yè)面滾動(dòng)時(shí)浮動(dòng)窗口控件
- Android利用浮動(dòng)窗口提示用戶操作
相關(guān)文章
JS實(shí)現(xiàn)的找零張數(shù)最小問(wèn)題示例
這篇文章主要介紹了JS實(shí)現(xiàn)的找零張數(shù)最小問(wèn)題,涉及javascript數(shù)學(xué)運(yùn)算相關(guān)操作技巧,需要的朋友可以參考下2017-11-11微信小程序?qū)崿F(xiàn)下滑到底部自動(dòng)翻頁(yè)功能
這篇文章主要為大家詳細(xì)介紹了微信小程序?qū)崿F(xiàn)下滑到底部自動(dòng)翻頁(yè)功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-03-03關(guān)于layui導(dǎo)航欄不展示下拉列表的解決方法
今天小編就為大家分享一篇關(guān)于layui導(dǎo)航欄不展示下拉列表的解決方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-09-09javascript與CSS復(fù)習(xí)(《精通javascript》)
js和css結(jié)合來(lái)產(chǎn)生醒目的交互效果,我們可以快速的訪問(wèn)元素自身的樣式屬性2010-06-06