HTML选择选项宽度在IE中被裁剪。任何解决方案 [英] HTML Select options width is cropped in IE. Any solutions?

查看:105
本文介绍了HTML选择选项宽度在IE中被裁剪。任何解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mozilla和非IE浏览器中,如果选择列表的选项长度大于选择的宽度,它将显示出来。但在IE中,它会将选项裁剪至选定的宽度。

In Mozilla and non-IE browsers, if the option of select list is of a greater length than the select's width, it will show up. But in IE, it will crop the option up to the select's width.

有没有办法让IE的选择行为与非IE浏览器类似?

Is there any way to make IE's select behaviour to be like that of non-IE browsers?

推荐答案

这似乎很适合强制IE重新评估选择宽度。适用于IE7和IE8。

This seems to work well in forcing IE to reevaluate the select width. Works in IE7 and IE8.

if (jQuery.browser.msie) {
    jQuery("#" + selectID).css("width", "100%").css('width', 'auto');
}

这篇关于HTML选择选项宽度在IE中被裁剪。任何解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆