Created
December 11, 2012 17:52
-
-
Save tonatiuh/4260611 to your computer and use it in GitHub Desktop.
Incremental height fix in the ddslick selector jquery plugin bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} | |
}); | |
} |
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
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...