Reply To: SmartMenus vs Lightbox jquery conflict

Home Forums Older releases 0.9.x SmartMenus vs Lightbox jquery conflict Reply To: SmartMenus vs Lightbox jquery conflict

#2253
admin
Keymaster

You are including 2 versions of jQuery on your page and this probably creates a conflict. This:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

includes jQuery 1.3.2 and this:

<script type="text/javascript" src="js/smartmenus/libs/jquery-loader.js"></script>

includes 1.10.2.

Since I am not sure if your Lightbox plugin works with jQuery versions newer than 1.3.2, I would suggest doing the following:

1) Remove the SmartMenus jQuery code you currently use:

<!-- jQuery -->
<script type="text/javascript" src="js/smartmenus/libs/jquery-loader.js"></script>

<!-- SmartMenus jQuery plugin -->
<script type="text/javascript" src="js/smartmenus/jquery.smartmenus.js"></script>

<!-- SmartMenus jQuery init -->
<script type="text/javascript">
	$(function() {
		$('#main-menu').smartmenus({
			subMenusSubOffsetX: 1,
			subMenusSubOffsetY: -8
		});
	});
</script>

2) Configure your Lightbox so that it works as you wish.

3) Add the SmartMenus code like this:

<!-- jQuery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery.noConflict();
</script>

<!-- SmartMenus jQuery plugin -->
<script type="text/javascript" src="js/smartmenus/jquery.smartmenus.js"></script>

<!-- SmartMenus jQuery init -->
<script type="text/javascript">
	jQuery(function() {
		jQuery('#main-menu').smartmenus({
			subMenusSubOffsetX: 1,
			subMenusSubOffsetY: -8
		});
	});
</script>

Let me know if you still have any troubles after that.

Register

You will be emailed a link to set your password.

Login

Lost password?