現在先把代碼拷貝到這裡
實現滾動效果
var all=
var no=
var s_width=
$(document)
all=$(
s_width=$(
$("#slides")
var contiar=$(
for(var i=
contiar
}
$(
var index=$(this)
no=index;
var no_= no%all;
$("#slides")
$(this)
$(this)
});
setInterval(function(){
var no_= no%all;
$("#slides")
var curr= $(
curr
curr
no++;
}
});
css 代碼如下
img{
border:none;
}
#daohangpic {
width:
margin:
padding:
overflow:hidden;
}
#daohangpic img {
height:
width:
}
#contiar {
position:relative;
width:
height:
overflow:hidden;
margin:
}
#slides {
position:absolute;
border:none;
}
float:left;
width:
height:
overflow:hidden;
border:none;
}
position:absolute;
bottom:
right:
z
}
list
}
float:left;
width:
height:
margin
text
background:#
border:
cursor: pointer;
opacity:
}
position:absolute;
height:
width:
background
bottom:
padding
padding
overflow:hidden;
z
background:url(hdpng
}
color: #FFF;
font
font
line
}
display: block;
color: #
font
line
}
要實現滾動的區域定義如下
<div id="daohangpic">
<div id="contiar">
<div id="slides">
<div class="slide"> <a href="格萊美獲獎名單揭曉
<div class="caption" >
<h
<p>格萊美獲獎名單揭曉
</div>
</div>
<div class="slide" > <a href="海內外人氣明星齊聚
<div class="caption" >
<h
<p>格萊美獲獎名單揭曉
</div>
</div>
<div class="slide" > <a href="令狐沖
<div class="caption" >
<h
<p>格萊美獲獎名單揭曉
下 </div>
</div>
<div class="slide" > <a href="陳鍵鋒戀上剩女陳紫函
<div class="caption" >
<h
<p>格萊美獲獎名單揭曉
場? </div>
</div>
<div class="slide" > <a href="感悟生命之美
<div class="caption" >
<h
<p>格萊美獲獎名單揭曉
</div>
</div>
</div>
<ul class="control_links">
</ul>
</div>
<div id="back_img"> </div>
</div>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20572.html