Skip to content

Instantly share code, notes, and snippets.

@eqdw
Created October 25, 2012 20:41
Show Gist options
  • Save eqdw/3955258 to your computer and use it in GitHub Desktop.
Save eqdw/3955258 to your computer and use it in GitHub Desktop.
$(function(){
var widths = {},
wrapped = {},
brokenIESelects = $(".brokenIESelects");
brokenIESelects.live("activate", function(){
var $elem = $(this),
id = $elem.attr("id");
if(widths[id] === undefined){
widths[id] = $elem.css("width");
}
if(! wrapped[id]){
$elem.wrap("<div style='width: " + $elem.css('width') + ";'> </div>");
$elem.css("position", "absolute");
wrapped[id] = true;
}
$elem.css("width", "auto");
});
brokenIESelects.live("change", function(){
var $elem = $(this);
$elem.blur();
});
brokenIESelects.live("blur", function(){
var $elem = $(this),
id = $elem.attr('id');
$elem.css("width", widths[id]);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment