gpt4 book ai didi

jquery - "jQuery("#marquee ").marquee is not a function"错误

转载 作者:行者123 更新时间:2023-12-01 06:55:56 26 4
gpt4 key购买 nike

我正在尝试使用 jQuery 的选取框插件。
但我在 FireBug 控制台 jQuery("#marquee").marquee is not a function 中收到此错误.
我的代码是这样的:

<script src="jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="jquery.marquee.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function (){
jQuery("#marquee").marquee();
});
</script>

我的 html 是:

<ul id="marquee" class="marquee"> 
<li>Some text</li>
</ul>

我正在使用这个字幕插件:
http://www.givainc.com/labs/marquee_jquery_plugin.htm

有什么问题吗?

-----编辑-----
我在一个独立的页面上测试了它,除了字幕代码之外什么都没有,并且它有效!
我认为我正在使用的其他库出现了问题。
我的整个<head>是:

<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="generator" content="Joomla! 1.7 - Open Source Content Management" />
<title>title</title>
<link href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=89&amp;Itemid=559&amp;format=feed&amp;type=rss" rel="alternate" type="application/rss+xml" title="RSS 2.0" />
<link href="/joomla/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=89&amp;Itemid=559&amp;format=feed&amp;type=atom" rel="alternate" type="application/atom+xml" title="Atom 1.0" />
<link href="http://localhost/joomla/index.php?option=com_search&amp;view=category&amp;layout=blog&amp;id=89&amp;Itemid=559&amp;format=opensearch" rel="search" title="title" type="application/opensearchdescription+xml" />
<link rel="stylesheet" href="/joomla/media/system/css/modal.css" type="text/css" />
<link rel="stylesheet" href="/joomla/plugins/content/attachments/attachments.css" type="text/css" />
<link rel="stylesheet" href="/joomla/plugins/content/attachments/attachments1.css" type="text/css" />
<link rel="stylesheet" href="media/system/css/jquery.marquee.css" type="text/css" />
<script src="/joomla/media/system/js/core.js" type="text/javascript"></script>
<script src="/joomla/media/system/js/mootools-core.js" type="text/javascript"></script>
<script src="/joomla/media/system/js/caption.js" type="text/javascript"></script>
<script src="/joomla/media/system/js/mootools-more.js" type="text/javascript"></script>
<script src="/joomla/media/system/js/modal.js" type="text/javascript"></script>
<script src="/joomla/plugins/content/attachments/attachments_refresh.js" type="text/javascript"></script>
<script src="media/system/js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="media/system/js/jquery.marquee.js" type="text/javascript"></script>
<script type="text/javascript">
function keepAlive() { var myAjax = new Request({method: "get", url: "index.php"}).send();} window.addEvent("domready", function(){ keepAlive.periodical(840000); });
window.addEvent('domready', function() {

SqueezeBox.initialize({});
SqueezeBox.assign($$('a.modal'), {
parse: 'rel'
});
});
window.addEvent('domready', function() {

SqueezeBox.initialize({});
SqueezeBox.assign($$('a.modal-button'), {
parse: 'rel'
});
});

jQuery.noConflict();
jQuery(document).ready(function (){
jQuery("#marquee").marquee();
});
</script>
<link type="text/css" rel="stylesheet" href="http://localhost/joomla/plugins/content/jumultithumb/assets/style.css" />
<link rel="stylesheet" href="/joomla/templates/siteground-j16-25/css/template.css" type="text/css" />
<script type="text/javascript" src="/joomla/templates/siteground-j16-25/js/CreateHTML5Elements.js"></script>
<script type="text/javascript" src="/joomla/templates/siteground-j16-25/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">jQuery.noConflict();</script>
<script type="text/javascript" src="/joomla/templates/siteground-j16-25/js/sgmenu.js"></script>

最佳答案

看到您更新的问题,问题就很清楚了。您正在第二次加载 jquery(最后第三行),这当然会覆盖之前加载的所有插件。由于对 .marquee 的调用是异步的(回调到就绪事件),因此插件在调用回调时就消失了。

解决方案:第二次加载 jquery 时删除该内容。

关于jquery - "jQuery("#marquee ").marquee is not a function"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9183042/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com