我无法让this version of the vTicker plugin为我工作,即使这些说明非常简单。
我可能遗漏了一些显而易见的东西,但是我安装了JQuery vTicker插件,加载了JQuery 1.7.2并创建了插件可以获取其ID的必要元素,但我输出的元素没有被操作JQuery。
请参阅this fiddle,我的html如下所示。
<div id="ticker">
<ul>
<li>One fish, two fish, red fish, blue fish.</li>
<li>Four fish, five fish, jump fish, dive fish.</li>
<li>Six fish, seven fish... what? Eleven fish?</li>
</ul>
</div>
<script>
$(function() {
$('#ticker').vTicker();
});
</script>
答案 0 :(得分:1)
此代码有效 - 检查您的代码以查看不同之处:
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://richhollis.github.com/vticker/downloads/jquery.vticker.js?v=1.13"></script>
</head>
<body>
<div id="ticker">
<ul>
<li>One fish, two fish, red fish, blue fish.</li>
<li>Four fish, five fish, jump fish, dive fish.</li>
<li>Six fish, seven fish... what? Eleven fish?</li>
</ul>
</div>
<script>
$(function() {
$('#ticker').vTicker();
});
</script>
</body>
</html>