Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

SmartMenus vs Lightbox jquery conflict

Home › Forums › Older releases › 0.9.x › SmartMenus vs Lightbox jquery conflict

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1423
    proyec
    Participant

    Hi,

    I have problem with combining SmartMenu (for menu) and Lightbox (to enlarge the pictures).
    I can’t run them simultaneously.

    If I test them separately, both work perfectly.

    http://www.institutobarandiaran.com/galeria_interior.asp?id=81&idp=0

    Can anyone help me with this?

    Thanks!

    #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.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘0.9.x’ is closed to new topics and replies.