我正在尝试使用jquery vertical ticker我尝试了一个只包含自动收报机的测试页面,它运行正常。但是当我将它集成到我想要部署它的真实页面时,它会出现这个错误:
Uncaught TypeError: Object [object Object] has no method 'vTicker' index.jsp:46
(anonymous function) index.jsp:46
jQuery.Callbacks.fire jquery-1.7.js:1064
jQuery.Callbacks.self.fireWith jquery-1.7.js:1182
jQuery.extend.ready jquery-1.7.js:437
DOMContentLoaded
这是我的代码:
<style type="text/css">
#news-container
{
width: 400px;
margin: auto;
margin-top: 30px;
border: 5px solid #333333;
}
#news-container ul li div
{
border: 1px solid #aaaaaa;
background: #ffffff;
}
</style>
<script type="text/javascript" src="../assets/js/lib/jquery-1.7.js"></script>
<script type="text/javascript" src="../assets/js/lib/jquery.vticker.js"> </script>
<script type="text/javascript">
jQuery(function(){
jQuery('#news-container').vTicker({
speed: 500,
pause: 3000,
animation: 'fade',
mousePause: false,
showItems: 3
});
});
</script>
<script type="text/javascript" src="../assets/js/lib/all-concat.js"/>
这是正文中的html div:
<div id="news-container">
<ul>
<li>
<div>
1) Lorem ipsum dolor sit amet, porta at, imperdiet id neque. more info
</div>
</li>
<li>
<div>
2) Lorem ipsum dolor sit amet, consectetur adipiscing elit. more info
</div>
</li>
<li>
<div>
3) Lorem ipsum dolor sit amet more info more info more info more info
</div>
</li>
<li>
<div>
4) jugbit.com jquery vticker more info more info more info more info more info
</div>
</li>
</ul>
知道为什么它在单独的页面中工作而不在这里工作吗?