我试过在网上搜索,但仍然无法理解为什么我的jQuery函数不能在Joomla中工作。Joomla 3和自定义jQuery函数 - 未定义函数
所以,我有OrionMenu,我想融入我的Joomla 3
作为一个独立的这个菜单的伟大工程,而是试图将其加载到之后的Joomla - Chrome浏览器的控制台说我每次翻身时菜单:
Uncaught TypeError: undefined is not a function jquery-1.10.1.min.js:4
(anonymous function) jquery-1.10.1.min.js:4
n.event.special.(anonymous function).handle jquery.min.js:3
n.event.dispatch jquery.min.js:3
r.handle jquery.min.js:3
搜索后,我发现的Joomla加载它自己的jQuery在noconflict模式,所以我试图整合OrionMenu的其他方式,而现在它说:
Uncaught TypeError: undefined is not a function (index):47
(anonymous function) (index):47
c jquery-1.10.1.min.js:4
p.fireWith jquery-1.10.1.min.js:4
x.extend.ready jquery-1.10.1.min.js:4
q
我的索引文件的第47行是:
jQuery(document).ready(function() { jQuery().orion({speed: 500}); });
我原来OrionMenu包括是这样的:
<link href="templates/<?php echo $this->template; ?>/menu-orion/css/styles.css" rel="stylesheet">
<script type="text/javascript" src="templates/<?php echo $this->template; ?>/menu-orion/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
var $j = jQuery.noConflict();
// $j is now an alias to the jQuery function; creating the new alias is optional.
$j(document).ready(function() { $j().orion({speed: 500});});
</script>
读我改变了它在网络上的一些东西后,已经提到的一段代码,返回一个控制台错误 - 索引线上的未定义函数47
我以某种方式相信Joomla的这段代码打破了一切。
<script type="text/javascript">
jQuery(window).on('load', function() {
new JCaption('img.caption');
});
</script>
但不管怎么说,帮助将是惊人的:)如果你知道如何实现或者什么大概可能是错jQuery(document).ready(function() { jQuery().orion({speed: 500}); });
将是巨大的。
在此先感谢!
@Patrick埃文斯 - 是的,我加载它们只是标签 – mrGott 2014-09-23 18:14:37
之前你还在包括一个单独的jQuery文件意味着额外的一到一个的Joomla包括 – 2014-09-23 18:18:00
@Patrick埃文斯? - – mrGott 2014-09-23 18:20:32