亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jquery實(shí)現(xiàn)的Banner廣告收縮效果代碼

 更新時(shí)間:2015年09月02日 15:16:41   作者:企鵝  
這篇文章主要介紹了jquery實(shí)現(xiàn)的Banner廣告收縮效果代碼,可實(shí)現(xiàn)點(diǎn)擊按鈕收縮與展開廣告圖片的功能,非常簡(jiǎn)單實(shí)用,需要的朋友可以參考下

本文實(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ì)有所幫助。

相關(guān)文章

最新評(píng)論