0
我有這樣的腳本:如何在該腳本中添加項目符號?
https://jsfiddle.net/4zuzxdxf/14/
代碼HTML:
<div id="slideshow">
<ul>
<li><img src="http://revistasindromes.com/images/100x100.gif" alt="photo1" /><p>asdas</p></li>
<li><img src="http://placehold.it/100x100/4D99E0/ffffff.png&text=100x100" alt="photo2" /><p>ddd</p></li>
<li><img src="http://www.matthijskamstra.nl/laboratory/flashbox/example_img/100x100pixels.gif" alt="photo3" /><p>eee</p></li>
</ul>
<a href="#" class="slideshow-prev">prev</a>
<a href="#" class="slideshow-next">next</a>
</div>
CODE JS:
$('ul li').hide();
$('ul li:first').fadeIn();
setInterval(function() {
$('.slideshow-next').click();
}, 6000);
var CurrentImage=0;
var AllImages=$('#slideshow ul li').length;
var NextImage=CurrentImage+1;
$('.slideshow-next').click(function(){
CurrentImage++;
if(CurrentImage>=AllImages)
{
CurrentImage=0;
}
$('ul li').hide();
$('ul li').eq(CurrentImage).fadeIn();
});
$('.slideshow-prev').click(function(){
CurrentImage--;
if(CurrentImage>=AllImages)
{
CurrentImage=0;
}
$('ul li').hide();
$('ul li').eq(CurrentImage).fadeIn();
});
CODE CSS:
#slideshow
{
margin:0 auto;
width:100px;
height:150px;
}
ul{list-style:none;}
我想爲此腳本添加項目符號...我添加了一個圖像以更好地理解他們想要的內容。
http://i61.tinypic.com/717286.jpg
我從來沒有這樣做,我需要儘可能簡單的一個例子。
你能幫我理解如何做到這一點嗎?
在此先感謝!
試試這個jQuery插件http://www.slidesjs.com/。查看「示例」部分了解更多詳情。 – Pugazh