我有一个<div>
列表(ul,li)。
我想要一个 Jquery 插件来更快地从左侧滚动文本并在<div>
. 然后文本向右滚动并消失。
你有插件名称吗?
谢谢。
编辑: 在 mrtsherman 的帮助下,我成功创建了脚本。有解决方案:
$(document).ready(function() {
$('#affichage_titreSemaine > span').css('opacity', '0');
function TitresSemaine() {
// get the item that currently has the 'show' class
var current = $('#affichage_titreSemaine .show');
var next = current.next().length ? current.next() : $('#affichage_titreSemaine span :first');
// fade out the current item and remove the 'show' class
current.animate( {opacity: "1.0", marginLeft: 465 - (current.width())/2}, 500, 'swing');
current.delay(2000).animate( {opacity: "0.0", marginLeft: 930 - current.width()}, 500, 'swing', function(){
$(this).animate({marginLeft : 0}, 10, 'swing');
$(this).hide();
next.addClass("show");
next.show();
}).removeClass("show");
// repeat by calling the textloop method again after 3 seconds
setTimeout(TitresSemaine,4000);
}
TitresSemaine();
});