[JavaScript/JQuery] jquery实现的Banner广告收缩效果代码
2016-03-29 17:38
686 查看
本文实例讲述了jquery实现的Banner广告收缩效果代码。分享给大家供大家参考。具体如下:
这里演示一个Banner广告收缩效果,点开后,网页显示大广告,用鼠标点击“关闭”后,广告会收缩上去,此效果已在各大网站见到过,欢迎借鉴使用。
运行效果截图如下:
在线演示地址如下:
http://demo.jb51.net/js/2015/jquery-banner-show-close-style-codes/
具体代码如下:
<!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>
<title>一个Banner广告收缩效果</title>
<style type="text/css">
*{margin:0; padding:0;}/*为了方便 直接这样重置了*/
#main{margin:0 auto; width:960px;}
#banner{display:none; margin:0 auto; width:960px; height:160px; background:url(images/banner.png) no-repeat; position:relative;}
#close{display:block; width:50px; height:22px; text-align:center; line-height:22px; border:1px #ddd solid; background:#000; color:#fff; font-size:12px; float:right; cursor:pointer;}
</style>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$http://m.nvzi91.cn/penqiangyan/29389.html
(
function()
{
$("#banner").slideDown();
var Up=function(){$("#banner").slideUp(1500)}
setTimeout(Up,3000);
$("#close").click
(
function()
{
$("#banner").slideToggle
(
600,function()
{
if($("#banner").css("display") == "none")
{
$("#close").text("打开");
}http://m.nvzi91.cn/luanchaonanzhong/29390.html
else
{
$("#close").text("关闭");
}
}
);
}
);
}
);http://m.nvzi91.cn/zigongai/29391.html
</script>
</head>
<body>
<div id="main">
<div id="banner"></div>
<span id="close">关闭</span>
</div>m.nvzi91.cn
</body>
</html>
这里演示一个Banner广告收缩效果,点开后,网页显示大广告,用鼠标点击“关闭”后,广告会收缩上去,此效果已在各大网站见到过,欢迎借鉴使用。
运行效果截图如下:
在线演示地址如下:
http://demo.jb51.net/js/2015/jquery-banner-show-close-style-codes/
具体代码如下:
<!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>
<title>一个Banner广告收缩效果</title>
<style type="text/css">
*{margin:0; padding:0;}/*为了方便 直接这样重置了*/
#main{margin:0 auto; width:960px;}
#banner{display:none; margin:0 auto; width:960px; height:160px; background:url(images/banner.png) no-repeat; position:relative;}
#close{display:block; width:50px; height:22px; text-align:center; line-height:22px; border:1px #ddd solid; background:#000; color:#fff; font-size:12px; float:right; cursor:pointer;}
</style>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$http://m.nvzi91.cn/penqiangyan/29389.html
(
function()
{
$("#banner").slideDown();
var Up=function(){$("#banner").slideUp(1500)}
setTimeout(Up,3000);
$("#close").click
(
function()
{
$("#banner").slideToggle
(
600,function()
{
if($("#banner").css("display") == "none")
{
$("#close").text("打开");
}http://m.nvzi91.cn/luanchaonanzhong/29390.html
else
{
$("#close").text("关闭");
}
}
);
}
);
}
);http://m.nvzi91.cn/zigongai/29391.html
</script>
</head>
<body>
<div id="main">
<div id="banner"></div>
<span id="close">关闭</span>
</div>m.nvzi91.cn
</body>
</html>
相关文章推荐
- [JavaScript/JQuery] jquery实现滑屏大图定时收缩为小banner图片的广告代码
- css在JQuery、JS、HTML中的写法
- Struts2+Jquery+JSON 实现ajax注册信息
- jQuery 效果 Fading 方法 - 淡入淡出
- jquery mobile开发中页面跳转后js不执行的问题
- jQuery表格插件datatables用法汇总
- jQuery toggle()用法
- jquery实现遮罩层
- myeclipse中导入的jquery文件报错(出现红叉叉,提示语法错误)
- JQuery选择器大全
- jQuery.Validate验证库
- ajax跨域系列--web api方式跨域
- jQuery.noConflict() 兼容其他插件的方法
- 修復jquery的tablesorter对加了千分位的数字无法正确排序的bug
- Struts2+jQuery+JSON 实现输入关键字后提示框显示数据
- 1 jQuery.fn.extend(); 2. jQuery.extend();
- jQuery学习笔记(一)
- 用jquery删除一个节点
- jquery.lazyload的使用
- 微信自带浏览器被输入法阻挡文本框的 jQuery 解决方法 by FungLeo