Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Incremental height fix in the ddslick selector jquery plugin bug
// It was happening when the options weren't having description, so the plugin gets inside this function and for some reason looks like the l0Height variable gets incremented (when it shouldn't).
// The fix for me was to put the line-height as constant with the:
// var lOHeight = '35px';
// line.
//Private: Adjust appearence for drop down options (move title to middle), when no desripction
function adjustOptionsHeight(obj) {
obj.find('.dd-option').each(function () {
var $this = $(this);
var lOHeight = '35px';
var descriptionOption = $this.find('.dd-option-description');
var imgOption = obj.find('.dd-option-image');
if (descriptionOption.length <= 0 && imgOption.length > 0) {
$this.find('.dd-option-text').css('lineHeight', lOHeight);
}
});
}
@johnbatdorf

This comment has been minimized.

Copy link

@johnbatdorf johnbatdorf commented Dec 21, 2012

Hey I'm having the same issue. I've put your fix in place, and it's not working, did you have to do anything else? It looks like a top margin gets added to everyone past 0, and then a bottom and top margin is added to the last one. - Thanks...

@grex22

This comment has been minimized.

Copy link

@grex22 grex22 commented Oct 20, 2015

This appears to still be present here in 2015, as I ran across it today. I fixed it just by setting a value of "& nbsp;" (without the space, since I couldn't type it here otherwise) to the data-description property on the tags. Probably could do something similar if you're building your menu via JSON too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment