jquery實(shí)現(xiàn)的Banner廣告收縮效果代碼
本文實(shí)例講述了jquery實(shí)現(xiàn)的Banner廣告收縮效果代碼。分享給大家供大家參考。具體如下:
這里演示一個(gè)Banner廣告收縮效果,點(diǎn)開后,網(wǎng)頁顯示大廣告,用鼠標(biāo)點(diǎn)擊“關(guān)閉”后,廣告會(huì)收縮上去,此效果已在各大網(wǎng)站見到過,歡迎借鑒使用。
運(yùn)行效果截圖如下:

在線演示地址如下:
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>一個(gè)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">
$
(
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("打開");
}
else
{
$("#close").text("關(guān)閉");
}
}
);
}
);
}
);
</script>
</head>
<body>
<div id="main">
<div id="banner"></div>
<span id="close">關(guān)閉</span>
</div>
</body>
</html>
希望本文所述對(duì)大家的jquery程序設(shè)計(jì)有所幫助。
- Android UI實(shí)現(xiàn)廣告Banner輪播效果
- 手把手教你用ViewPager自定義實(shí)現(xiàn)Banner輪播
- Android自動(dòng)播放Banner圖片輪播效果
- jquery實(shí)現(xiàn)簡單的banner輪播效果【實(shí)例】
- 簡單的jQuery banner圖片輪播實(shí)例代碼
- Android實(shí)現(xiàn)Banner界面廣告圖片循環(huán)輪播(包括實(shí)現(xiàn)手動(dòng)滑動(dòng)循環(huán))
- jquery實(shí)現(xiàn)滑屏大圖定時(shí)收縮為小banner圖片的廣告代碼
- jQuery+css3動(dòng)畫屬性制作獵豹瀏覽器寬屏banner焦點(diǎn)圖
- 運(yùn)用jQuery定時(shí)器的原理實(shí)現(xiàn)banner圖片切換
- jquery Banner輪播選項(xiàng)卡
相關(guān)文章
JQuery的Ajax請(qǐng)求實(shí)現(xiàn)局部刷新的簡單實(shí)例
本篇文章只要是對(duì)JQuery的Ajax請(qǐng)求實(shí)現(xiàn)局部刷新的簡單實(shí)例進(jìn)行了詳細(xì)的介紹,需要的朋友可以過來參考下,希望對(duì)大家有所幫助2014-02-02
jQuery中$.each()函數(shù)的用法引申實(shí)例
jQuery中的$.each()函數(shù)比forEach更加強(qiáng)大,可以用來遍歷JavaScript中的任意集合,借來下來我們會(huì)舉幾個(gè)jQuery中$.each()函數(shù)的用法引申實(shí)例,首先先來回顧一下遍歷用法的基礎(chǔ):2016-05-05
jQuery EasyUI API 中文文檔 - Dialog對(duì)話框
jQuery EasyUI API 中文文檔 - Dialog對(duì)話框使用說明,需要的朋友可以參考下。2011-11-11
jQuery實(shí)現(xiàn)左右切換焦點(diǎn)圖
這篇文章主要介紹了jQuery實(shí)現(xiàn)左右切換焦點(diǎn)圖的核心代碼,有需要的小伙伴可以參考下2015-04-04
jquery插件jquery.LightBox.js實(shí)現(xiàn)點(diǎn)擊放大圖片并左右點(diǎn)擊切換效果(附demo源碼下載)
這篇文章主要介紹了jquery插件jquery.LightBox.js實(shí)現(xiàn)點(diǎn)擊放大圖片并左右點(diǎn)擊切換效果,可實(shí)現(xiàn)仿相冊(cè)插件切換效果,并附代碼demo源碼供讀者下載參考,需要的朋友可以參考下2016-02-02
jQuery函數(shù)map()和each()介紹及異同點(diǎn)分析
這篇文章主要介紹了jQuery函數(shù)map()和each()介紹及異同點(diǎn)分析,需要的朋友可以參考下2014-11-11

