我正在使用 JCarouselLite (http://www.gmarwaha.com/blog/2007/08/09/jcarousel-lite-a-jquery-plugin/) 来生成垂直滚动的“新闻行情”式旋转木马的推荐和一切工作正常,但我想随机化列表项的显示顺序。我尝试使用以下内容,但它不起作用:
if(o.random){var randomStart = Math.floor( Math.random()*tl+1 );curr = randomStart;}
然后将“随机:真”添加到选项中。
有人可以帮我解决这个问题吗?我的脚本是:
<script type="text/javascript">
$(document).ready(function(){
$(".ticker").jCarouselLite({
auto: 10000,
vertical: true,
random: true,
visible: 1
});
});
</script>