CSS+JS实现的div层定位功能和自动消失
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CSS+JS实现的div层定位功能和自动消失,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2450字,纯文字阅读大概需要4分钟。
内容图文
CSS顶部固定功能,有空的时候研究了一下CSS的定位功能,做了这个大家熟悉的顶部固定功能,鼠标移上去顶部会消失,并可判断浏览器是否支持audio元素!顶部元素在时间控制下也可自动消失。
<! 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 >CSS+JS实现的div层定位功能和自动消失丨Daniel wellington官网</title></head><style type="text/css">/*<![CDATA[*/ body {margin:0; padding:0 10px 0 10px; border:0; height:100%; overflow:auto;} #menu {right:0; top:39px; width:100%; position:fixed; padding:10px; text-align:center; font-weight:bold; background:#ccc;} #menubottom {right:0; bottom:10px; width:100%; position:fixed; padding:10px; text-align:center; font-weight:bold; background:#ccc;} * html #menu {position:absolute; right:16px; top:0;} * html #menubottom {position:absolute; right:16px; bottom:0;} html {overflow:auto !important; overflow:hidden;} #menu2{ top:0;width:100%; position:fixed; padding:10px; text-align:center; font-weight:bold; background:#ccc;}/*]]>*/</style><script type="text/javascript">function nosee(){ var _menu = document.getElementById("menu"); _menu.style.height =‘100‘; _menu.style.display =‘none‘; } function autonosee(){ var _menubottom = document.getElementById("menubottom"); var _menu2 = document.getElementById("menu2"); var _menu = document.getElementById("menu"); _menubottom.style.display =‘none‘; _menu2.style.display =‘none‘; _menu2.style.overflow =‘hidden‘; _menu.style.top=‘0‘; } var ss=window.setInterval(function(){autonosee();},3000); </script><body><div id=‘menu2‘><font color=black>本特效由 <a target="_blank" href="http://www.qhgzgw.com" target="_blank">Daniel wellington</a>丨收集于互联网,只为兴趣与学习交流,不作商业用途。</font></div><div id="menu" onclick="nosee();">我顶部固定啦- 点击我后消失不见</div><input type="text" x-webkit-speech x-webkit-grammar="builtin:translate"/><audio preload="auto"><source src="baby-marry.mp3"></source><source src="baby-marry.ogg"></source><p>您的浏览器不支持<code>audio</code>元素!</p><br><br><hr></audio><div style=" height:1000px;"></div><div id="menubottom">我底部固定啦-过3秒钟之后我就不出现了</div></body></html>
原文:http://www.cnblogs.com/youtianxia/p/4740983.html
内容总结
以上是互联网集市为您收集整理的CSS+JS实现的div层定位功能和自动消失全部内容,希望文章能够帮你解决CSS+JS实现的div层定位功能和自动消失所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。