简体   繁体   English

SobiPro和MegaMenu中的jQuery错误/冲突

[英]Jquery error/conflict in SobiPro and MegaMenu

The mega menu doesn't work on SobiPro pages on my Joomla 2.5 install. 巨型菜单在我的Joomla 2.5安装中的SobiPro页面上不起作用。 I have been trying to find if there is a conflict but no luck so far. 我一直在尝试寻找是否有冲突,但是到目前为止没有运气。 Firebug throws up the following error which i have tried to amend but again no luck: Firebug抛出了以下错误,我已尝试修正,但再次没有运气:

TypeError: $(...).megamenu is not a function
'justify': 'left'

This relates the following area of javascript: 这与javascript的以下区域相关:

<script type="text/javascript">
jQuery(function($){
    $('#meganavigator').megamenu({
        'wrap':'#yt_menuwrap .container',
        'easing': 'jswing',
        'speed': '500',
        'justify': 'left'
    });
}); 
</script>

Should I surround .megamenu like this: $('.megamenu') ? 我是否应该这样围绕.megamenu$('.megamenu')

How do I go about finding the conflict (if there is one) and rectifying it? 如何找到冲突(如果有)并纠正冲突?

Any help is greatly appreaciated. 非常感谢您的帮助。 The menu works fine on standard conntet pages etc. Thanks 该菜单在标准内容页面等上正常运行。谢谢

Do you have a link? 你有链接吗? Without that it's hard to say for sure. 没有它,很难确定。 My guess would be that both Sobipro and MegaMenu are loading different versions of jQuery which is causing a conflict. 我的猜测是Sobipro和MegaMenu都在加载不同版本的jQuery,这会引起冲突。 Before I spent too much time messing with this, I would install jQuery easy. 在花太多时间搞定这个之前,我将轻松安装jQuery。 This will clean up all of the instances of jQuery being loaded and put everything in to no conflict mode. 这将清理所有正在加载的jQuery实例,并将所有实例置于无冲突模式。 The default parameters are generally enough to solve most problems but you might need to mess with it a little. 通常,默认参数足以解决大多数问题,但您可能需要对其进行一些处理。

http://extensions.joomla.org/extensions/core-enhancements/performance/jquery-scripts/18327 http://extensions.joomla.org/extensions/core-enhancements/performance/jquery-scripts/18327

I fixed by deleting the following line on components/com_sobipro/lib/js/jqnc.js: 我通过删除components / com_sobipro / lib / js / jqnc.js上的以下行来修复:

SobiPro.setJq( jQuery.noConflict() ); SobiPro.setJq(jQuery.noConflict());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM