当前位置:Gxlcms > JavaScript > JS简单实现浮动窗口

JS简单实现浮动窗口

时间:2021-07-01 10:21:17 帮助过:6人阅读

这篇文章主要介绍了JS简单实现浮动窗口效果,涉及javascript操作浮动窗口的创建、打开、关闭等相关操作技巧,需要的朋友可以参考下

本文实例讲述了JS简单实现浮动窗口效果。分享给大家供大家参考,具体如下:

HTML部分:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
*{ margin:0; padding:0;}
a img{ border:0;}
</style>
</head>
<body>
<p style="height:2000px; background:#ccc; display:none;">
</p>
<!--p id="floatAd" style=" position:fixed !important; position:absolute; _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight)); z-index: 2147483647; left: 50%; margin-left: -240px !important; top: 50%; margin-top: -210px !important; background:url(images/onlineSay.jpg) no-repeat; width:487px; height:350px; cursor:pointer;">
<p onclick="closeFAd();" style=" width:26px; height:26px; float:right;"></p>
<p style="width:487px; height:320px; float:right;" onclick="open_online();"></p>
</p>
<p id="floatSide" style=" width:141px; height:579px; position:fixed !important; position:absolute; _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight)); z-index: 99999; right:0; top:6%; background:url(images/onlineTel.gif);cursor:pointer;" onclick="open_online();></p-->
</body>
</html>
<script type="text/javascript" src="online.js"></script>

JS部分:

效果图如下:

相关推荐:

JS实现动态雪花飘落

canvas与JS实现动态时钟动画

以上就是JS简单实现浮动窗口的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行