我尝试了很多方法来为我的幻灯片添加字幕,但都做不到。只想在每个图像的底部添加一个 div,我应该更改我的脚本吗?还是应该添加其他东西?
HTML:
<div class="minislider">
<img src="http://www.no-margin-for-errors.com/wp-content/themes/NMFE/images/fullscreen/1.jpg" />
<img src="http://www.no-margin-for-errors.com/wp-content/themes/NMFE/images/fullscreen/2.jpg" />
<img src="http://www.no-margin-for-errors.com/wp-content/themes/NMFE/images/fullscreen/3.jpg" />
<img src="http://www.no-margin-for-errors.com/wp-content/themes/NMFE/images/fullscreen/4.jpg" />
</div>
CSS:
.minislider {
width: 321px;
height: 242px;
background-color: #649696;
position: relative;
float: left;
left: 76px;
top: 11px;
border-radius: 10px 10px 10px 10px;
}
.minislider img {
width: 311px;
height: 232px;
position: absolute;
left: 5px;
top: 5px;
}
查询:
$(document).ready(function (){
$('.minislider img:gt(0)').hide();
setInterval(function(){
$('.minislider :first-child').fadeOut()
.next('img').fadeIn()
.end().appendTo('.minislider');
}, 3000);
});