Skip to content

Instantly share code, notes, and snippets.

@ografael
Created July 4, 2012 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ografael/3044317 to your computer and use it in GitHub Desktop.
Save ografael/3044317 to your computer and use it in GitHub Desktop.
fix_combo_ie.js
$(function() {
var el;
$("select")
.each(function() {
el = $(this);
el.data("origWidth", el.outerWidth()) // IE 8 will take padding on selects
})
.mouseenter(function(){
$(this).css("width", "auto");
})
.bind("blur change", function(){
el = $(this);
el.css("width", el.data("origWidth"));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment