MyBB Community Forums

Full Version: Jquery help?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
We're using a jquery code for tabs.

<script type='text/javascript' src='http://code.jquery.com/jquery-latest.min.js'></script>
<script type='text/javascript'> jQuery.noConflict(); </script>
<script type='text/javascript' src='http://yourjavascript.com/1211131136/jquery.cookie.js'></script>
<script type='text/javascript' src='http://domodoom.jfbs.net/uploads/domodoom/Click_over_tabs.js'></script>

But with noconflict the Click over tabs doesn't work. If we remove the noconflict the mybb post editor, mass moderation, quick edit, etc doesn't work anymore. Is there a way to fix this?
May be I sound like a fool, but don't use latest. Use this:

<script src="//code.jquery.com/jquery-1.8.2.min.js"></script>

or

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
That didn't work sadly. Sad

It does work if I remove noconflict:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type='text/javascript' src='http://yourjavascript.com/1211131136/jquery.cookie.js'></script>
<script type='text/javascript' src='http://domodoom.jfbs.net/uploads/domodoom/Click_over_tabs.js'></script>

But everything else breaks.
I didn't tell you to remove noConflict line. did I?
Just replace the main lib path (first line).

Also, remove the last line, this:

<script type='text/javascript' src='http://domodoom.jfbs.net/uploads/domodoom/Click_over_tabs.js'></script>

and include this code:

<script type='text/javascript'>
jQuery.noConflict();
jQuery(function () {
    function selectTab(tab) {
        var i = 1;
        while (jQuery('#tab' + i).length) {
            if (tab.attr('id') !== 'tab' + i) {
                jQuery('#tab' + i).removeClass('highlight');
                jQuery('#tab' + i + '-content').hide();
            } else {
                tab.addClass('highlight');
                jQuery('#tab' + i + '-content').show();
            }
            i++;
        }
    }
    jQuery('#tab1').addClass('highlight');
    jQuery('.clickable').each(function () {
        jQuery(this).click(function () {
            selectTab(jQuery(this));
        });
    });
});
</script>
It didn't work, so I removed no conflict, and it worked agian. Which was odd and broke the other parts.

However, effone! That code you just gave me fixed it all! completely!