1/** 2 * IE8 下 select option 内容过长 , 展开时信息显示不全 , 简单折衷的方式就是给 option 加上 title 属性 , 但是又不想一个个的修改,怎么办呢,代码如下 : 3 */ 4$(document).delegate('select', 'mouseover', function(){ 5 var $this = $(this); 6if($this.data('data-bind-title')) 7 { 8 return; 9 } 10$this.data('data-bind-title', true).find('option').each(function(){ 11 var $option = $(this); 12 var _text = $.trim($option.text()); 13if(_text.length > 0 && !$option.attr('title')){ 14 $option.attr('title', _text); 15 } 16 }); 17});
IE8 下 select option 内容过长 , 展开时信息显示不全问题解决办法
Wesley13
2021-10-11
1049 0 0
点赞
收藏
评论区
加载中...