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.

suzyb

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Vertically aligning navigation stops dropdowns working #3417
    suzyb
    Participant

    That’s awesome, thanks so much.

    in reply to: Centering dropdown in relation to parent #3387
    suzyb
    Participant

    Thanks for posting your code. My solution doesn’t take into account any options we don’t have set so I’m sure yours will be very useful in the future.

    in reply to: Centering dropdown in relation to parent #3384
    suzyb
    Participant

    I was wrong about the offset used, it’s mainMenuSubOffsetX that does the correct thing.

    I managed to come up with a solution that seems to work. The following code I added after the ‘hide.smapi’ binding in the jquery.smartmenus.bootstrap.js file.

    'beforeshow.smapi': function (e, menu) {
    	var $menu = $(menu), obj = $(this).data('smartmenus');
    
    	obj.opts.mainMenuSubOffsetX = 0;    // reset so it isn't held over between different dropdowns
    
    	var width = obj.getWidth($menu.dataSM('parent-a'));
    	var subWidth = obj.getWidth($menu);
    
    	if (subWidth > width) {
    		obj.opts.mainMenuSubOffsetX = -Math.abs((subWidth - width) / 2) + 'px';
    	}
    }
Viewing 3 posts - 1 through 3 (of 3 total)