Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 限制多选菜单中显示的字符数_Javascript_Jquery_Html_Css - Fatal编程技术网

Javascript 限制多选菜单中显示的字符数

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=

我有一个菜单,我想样式看起来“更好”

以下是菜单的图像:

以下是当前的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="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;
}