1,思路:
當你打開頁面的時候廣告彈出
但你點選關閉的時候,廣告消失
2,html代碼
1 <div class="a">
2 <span></span>
3 </div>
3,css代碼
1 .a{
2 position:fixed;
3 right:0;
4 bottom:0;
5 width:40px;
6 height:40px;
7 background:url("../img/1.jpg");
8 display:none;
9 }
10 .a span{
11 position:absolute;
12 right:0;
13 top:0;
14 width:40px;
15 height:40px;
16 background:url("../img/2.jpg");//這是上邊那個關閉圖檔
17 }
4,jQuery代碼
1 $(function(){
2 $(".a")
3 .slideDown()
4 .slideUp(1000)
5 .fadeIn(1000)
6 .find("span").click(function(){
7 $(this).parent().fadeOut();
8 })
9 })