MyBB Community Forums
jQuery and Prototype conflict - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: jQuery and Prototype conflict (/thread-105959.html)



jQuery and Prototype conflict - Tomasz Knapik - 2011-10-15

Hello,
i don't now if I'm writing in good forum, but i've got problem with Nivo Slider(website).This plugin uses jQuery, but in MyBB I must have Prototype. I tried solve it with jQuery.noConflict etc. but don't work. I use the slider only in portal.
Parts of portal template:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="jscripts/jquery.nivo.slider.pack.js"></script>
[...]
</head>
[...]
        <div class="slider-wrapper theme-default">
            <div id="slider" class="nivoSlider">
                <img src="images/rppl/slider/gmg.png" alt="" title="GMG" /> 
                <img src="images/rppl/slider/lspt.png" alt="" title="LSPT" /> 
                <img src="images/rppl/slider/lspd.png" alt="" title="LSPD" />
                <img src="images/rppl/slider/6thse.png" alt="" title="5th" />
            </div>
<script type="text/javascript"> 
   jQuery.noConflict(); 
    jQuery(window).load(function() { 
       jQuery('#slider').nivoSlider(); 
    }); 
    </script> 
    [...]
Headerinclude template:
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1600"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1600"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1600"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/jquery.min.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/jquery-ui.min.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/jquery.cookie.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/user.panel.js"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/usertabs.js"></script>
{$stylesheets}
<script type="text/javascript">
<!--
	var cookieDomain = "{$mybb->settings['cookiedomain']}";
	var cookiePath = "{$mybb->settings['cookiepath']}";
	var cookiePrefix = "{$mybb->settings['cookieprefix']}";
	var deleteevent_confirm = "{$lang->deleteevent_confirm}";
	var removeattach_confirm = "{$lang->removeattach_confirm}";
	var loading_text = '{$lang->ajax_loading}';
	var saving_changes = '{$lang->saving_changes}';
	var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
	var my_post_key = "{$mybb->post_code}";
	var imagepath = "{$theme['imgdir']}";
// -->
</script>
{$newpmmsg}