Home > Web Front-end > JS Tutorial > body text

js实现网站最上边可关闭的浮动广告条代码

PHPz
Release: 2018-09-28 17:59:46
forward
2039 people have browsed it

这篇文章主要介绍了js实现网站最上边可关闭的浮动广告条代码,涉及javascript基于鼠标事件操作页面元素样式的实现技巧,需要的朋友可以参考下

本文实例讲述了js实现网站最上边可关闭的浮动广告条。分享给大家供大家参考。具体如下:

这是一款广告条代码,平时浮动在网站最上边,可关闭,设计唯美简洁,带关闭按钮,自适应网页宽度,色调明了,相信有不少朋友会喜欢的.

运行效果截图如下:

在线演示地址如下:

http://demo.jb51.net/js/2015/js-top-float-clase-able-adv-codes/

具体代码如下:

<html>
<head>
<title>网站页首可关闭广告条</title>
<style type="text/css">
<!--
body { margin: 0px;padding: 0px;text-align: center;}
TD {FONT-SIZE: 12px; COLOR: #333;}
#topadv {BORDER-BOTTOM: #e2e2e2 1px solid;}
-->
</style>
</head>
<body>
<SCRIPT>
 function floatadv(){
  document.getElementById("topadv").style.display="none";
 }
</SCRIPT>
<p id=topadv>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr>
 <td width="4%" height="30" align="center"><img src="images/kids.gif" width="15" height="14"></td>
 <td width="82%"><a href="//www.jb51.net/">脚本之家</a>是国内专业的网站建设资源、脚本编程学习类网站,提供asp、php、asp.net、javascript、jquery、vbscript、dos批处理、网页制作、网络编程、网站建设等编程资料。</td>
 <td width="14%" align="right"><a style="CURSOR: hand" onClick=floatadv()><img 
 src="images/close.gif" width=84 height=11 hspace="6" border=0></a></td>
 </tr>
</table>
</p>
</body>
</html>
Copy after login

以上就是本章的全部内容,更多相关教程请访问JavaScript视频教程

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!