简体   繁体   中英

Jquery error/conflict in SobiPro and MegaMenu

The mega menu doesn't work on SobiPro pages on my Joomla 2.5 install. 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:

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

This relates the following area of 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') ?

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. Before I spent too much time messing with this, I would install jQuery easy. This will clean up all of the instances of jQuery being loaded and put everything in to no conflict mode. 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

I fixed by deleting the following line on components/com_sobipro/lib/js/jqnc.js:

SobiPro.setJq( jQuery.noConflict() );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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