【发布时间】:2014-02-14 12:46:15
【问题描述】:
我是在制作新闻自动收报机之后,这是我第一次看到这个网站。
http://www.jquerynewsticker.com/
我把代码全部设置成这样
<div class="news_ticker"><link href="LPMS\production_scn\jquery_news_ticker\styles\ticker-style.css" rel="stylesheet" type="text/css" />
<script src="LPMS\production_scn\jquery_news_ticker\includes\jquery.ticker.js" type="text/javascript"></script>
<ul id="js-news" class="js-hidden">
<li class="news-item"><a href="#">This is the 1st latest news item.</a></li>
<li class="news-item"><a href="#">This is the 2nd latest news item.</a></li>
<li class="news-item"><a href="#">This is the 3rd latest news item.</a></li>
<li class="news-item"><a href="#">This is the 4th latest news item.</a></li>
</ul>
<script type="text/javascript">
$(function () {
$('#js-news').ticker();
});
</script>
</div>
我假设这一切都在 1 div 中?它简单地列出了最新项目新闻而不是滚动或任何东西,它几乎就像它没有拿起 jquery 但我已经扎根它来找到源头,谁能帮我解释一下?
编辑/更新
感谢 Java_User,我已经设法让它有点工作,现在我的问题是它不会显示我要求它输出的内容,即使我更改文本/输入它也只显示一行。
我的代码现在是......这是在头脑中
<link href="/LPMS/production_scn/jquery_news_ticker/styles/ticker-style.css" rel="stylesheet" type="text/css" />
<script src="/LPMS/production_scn/jquery_news_ticker/includes/jquery.ticker.js" type="text/javascript"></script>
</head>
这是在页面的底部(页面的其余部分是空的,以避免任何冲突!)
<div class="clear_line"></div>
<script type="text/javascript">
$(function () {
$('#js-news').ticker();
});
</script>
<!-- News Feed ticker - use jquery to scroll ticker!! -->
<div class="news_feed">
<img src="/LPMS/images/news/breaking_news.png" style="border-style:none;">
<div class="news_ticker"><ul id="js-news" class="js-hidden">
<li class="news-item"><a href="#">This is the 1st latest news item.</a></li>
<li class="news-item"><a href="#">This is the 2nd latest news item.</a></li>
<li class="news-item"><a href="#">This is the 3rd latest news item.</a></li>
<li class="news-item"><a href="#">This is the 4th latest news item.</a></li>
</ul> </div></div>
</div>
任何想法为什么它只显示下划线_这样?它让我头疼!
谢谢
【问题讨论】:
-
你的 jQuery 库包含在哪里?
-
我把它放在页面的上方,我现在把它放在 jquery.ticker.js 下面,我在脚本中使用 googleapi jquery。
标签: javascript jquery html ticker news-ticker