jQuery解決下拉框select設寬度時IE 6/7/8下option超出顯示不全

個人做了一些自定義的修改
復制代碼 代碼如下:
!--[if lt IE 9]
script type="text/javascript"
jQuery(function($){
var el;

$("select").each(function() {
el = $(this);
el.data("origWidth", el.css("width"));
// el.data("oriWidth",85);
})
.focusin(function(){
el=$(this);
el.css("width", "auto");

//if(el.width()el.data("oriWidth")){
// el.css("width", el.data("origWidth"));
//}

})
.bind("blur change ", function(){
el = $(this);
el.css("width", el.data("origWidth"));
});
});
/script
![endif]--
您可能感興趣的文章:jQuery獲取select選中的option的value值實現方法JQuery動態添加Select的Option元素實現方法JS & JQuery 動態添加 select optionjQuery操作Select的Option上下移動及移除添加等等JQuery中對Select的option項的添加、刪除、取值刪除select中所有option選項jquery代碼淺析jQuery對select操作小結(遍歷option,操作option)JQuery操作Select的Options的Bug(IE8兼容性視圖模式)jquery操作select option 的代碼小結jQuery動態產生select option下拉列表

相關經驗推薦