
现在先把代码拷贝到这里,以后再逐一简化修改: 
实现滚动效果,脚本代码如下: 
 代码如下: 
var all=0; 
var no=0; 
var s_width=0; 
$(document).ready(function(){ 
all=$('.slide').length; 
s_width=$('.slide').eq(0).width(); 
$("#slides").css('width',all*s_width); 
var contiar=$('.control_links'); 
for(var i=0;icontiar.append("
#contiar { 
position:relative; 
width:980px; 
height:380px; 
overflow:hidden; 
margin:0 auto; 
} 
#slides { 
position:absolute; 
border:none; 
} 
.slide { 
float:left; 
width:980px; 
height:380px; 
overflow:hidden; 
border:none; 
} 
.control_links{ 
position:absolute; 
bottom:10px; 
right:10px; 
z-index:200; 
} 
.control_links,.control_links li { 
list-style: none; 
} 
.control_links li { 
float:left; 
width: 15px; 
height: 15px; 
margin-right: 5px; 
text-align: center; 
background:#333; 
border: 1px solid #666; 
cursor: pointer; 
opacity:0.5; 
} 
.caption { 
position:absolute; 
height:50px; 
width:100%; 
background-color:#000; 
bottom:0px; 
padding-left:20px; 
padding-top:10px; 
overflow:hidden; 
z-index:100; 
background:url(hdpng.png) no-repeat scroll 0 -1px; 
} 
.caption h2 { 
color: #FFF; 
font-size: 17px; 
font-weight: bold; 
line-height:25px; 
} 
.caption p{ 
display: block; 
color: #767676; 
font-size:12px; 
line-height:15px; 
} 
 
要实现滚动的区域定义如下: 
 代码如下: 
 
 
 
  
 
 
格莱美获奖名单揭晓,众大腕颁奖礼现场飙歌
 
 格莱美获奖名单揭晓,众大腕颁奖礼现场飙歌
 
 格莱美获奖名单揭晓,众大腕颁奖礼现场飙歌
 
 格莱美获奖名单揭晓,众大腕颁奖礼现场飙歌
 
 格莱美获奖名单揭晓,众大腕颁奖礼现场飙歌
