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="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" οnclick="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\" οnclick=\"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);
});

 

效果图:

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值