我正在为我的web项目寻找一个简单的JavaScript字幕,并找到了这个:http://jsfiddle.net/4mTMw/8/
JavaScript如下所示:
var marquee = $('div.marquee');
marquee.each(function() {
var mar = $(this),indent = mar.width();
mar.marquee = function() {
indent--;
mar.css('text-indent',indent);
if (indent < -1 * mar.children('div.marquee-text').width()) {
indent = mar.width();
}
};
mar.data('interval',setInterval(mar.marquee,1000/60));
});
我真的很喜欢字幕的简单性,但我想不出如何让字幕停留在悬停状态。
如果有人能帮我指明正确的方向,我将不胜感激!
谢谢你,乔希
https://stackoverflow.com/questions/38380588
复制相似问题