MyBB Community Forums

Full Version: MyBB's JS conflicts with jQuery --- how to fix?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Basically, I'm "embedding" my site's forum into the main site's layout.

Of course, since the dropdown and tabs use jQuery, and MyBB uses Prototype, IIRC, there's a conflict, so MyBB's JS functions won't work.

Is there an easy way to fix this (primarily fixing the MyBB JS, since I don't want to touch the JQ stuff)?
The easiest way to do things is to use the actual jQuery tag, instead of the $ - because both Prototype and jQuery use this. jQuery is actually friendly with other libraries... just a shame Prototype and others aren't...

Either way, include this before any coding:

jQuery.noConflict(); jQuery(document).ready(function(){

Then you can use...

jQuery("#activator").click(function(){
     jQuery("#movediv").slideToggle(); });

... with no problems. This is the way I've done it (and have had no problems whatsoever). There are other ways - see the jQuery with other Languages on their Wiki.
EDIT: Nvm, I figured it out. Smile
Thank you soooo much, i resolve a conflict between jquery menu and java (expand-collapse and thread selection)
there is already a mybb plugin to include jquery snipets by audentio.com
http://community.mybb.com/thread-85031.html

I´ve tried once and it´s working great.
(2011-02-26, 05:34 PM)aglioeolio Wrote: [ -> ]there is already a mybb plugin to include jquery snipets by audentio.com
http://community.mybb.com/thread-85031.html

I´ve tried once and it´s working great.

Thank you aglioeolio
Getting jQuery to play nice with code examples.
Why arnt mybb using protoype it's stupid there using A less popular library just frustrating at times.
(2014-07-08, 08:05 AM)Spudster Wrote: [ -> ]Why arnt mybb using protoype it's stupid there using A less popular library just frustrating at times.

Uhm... they are?
And if u just miss-wrote your message, they've moved completely to jQuery in 1.8