Javascript 限制多选菜单中显示的字符数
我有一个菜单,我想样式看起来“更好” 以下是菜单的图像: 以下是当前的html:Javascript 限制多选菜单中显示的字符数,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我有一个菜单,我想样式看起来“更好” 以下是菜单的图像: 以下是当前的html: <button type="button" class="ui-multiselect ui-widget ui-state-default ui-corner-all customClass customClassTwo" aria-haspopup="true" tabindex="0" style="width: 120px;"> <span> <span class=
<button type="button" class="ui-multiselect ui-widget ui-state-default ui-corner-all customClass customClassTwo" aria-haspopup="true" tabindex="0" style="width: 120px;">
<span>
<span class="ellipsis_text" style="90px">Text to limit goes here</span>
</span>
</button>
它是一个带有过滤器的多选菜单,初始化如下:
$(function() {
$("#Id").multiselect({
height: 500,
minWidth: 280,
multiple: false,
selectedList: 1
}).multiselectfilter({
width: 300
});
$( "#Id" ).attr("name", "Id");
});
首先,我希望菜单在菜单中的箭头之前将文本切掉一点,而不是像您在图片中看到的那样在新行上显示文本的顶部
如果有人有任何想法那就太好了。叠前溢出搜索包括样式菜单上的搜索和使用javascript限制显示字符的数量,但这些搜索没有提供任何适用的结果
干杯给按钮一个高度和宽度,并将“溢出”设置为“无”,这将满足您的需要
button {
overflow: none;
height: 50px;
width: 10px;
}
none不是溢出的正确值,我尝试了其他值,但没有成功:/。谢谢。我在chrome工具中做了,我不确定它是否容易修复。我想不是,哈哈;-)嗯,这是我在jquery中发现的一个关于检测溢出的线程,谢谢,我很感激!
button {
overflow: none;
height: 50px;
width: 10px;
}