下拉中的大值无法在jsp中看到

时间:2018-03-30 07:10:04

标签: javascript jquery html5 user-interface



<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<select>
  <option value="volvo">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five</option>
  <option value="saab">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>
</body>
</html>
&#13;
&#13;
&#13;

我正在创建dynamicaly下拉列表。在那个用户可以创建200 /选项字符。 例如

 <select class="my_dropdown" id="my_dropdown">
    <option value="1"> value is upto 200 charactor.............200</option>
    <option value="2">value is upto 200 charactor..............200 charactor</option>
  </select> 

在浏览器中只显示uptu 100字符。休息是在浏览器之外,无法看到。 如果在浏览器上右键下拉,则无法看到大约40个字符。 如何在浏览器中显示完整的200个字符。

1 个答案:

答案 0 :(得分:0)

您无法包装原生select元素的文本,您需要一些像JQueryUI这样的javascript组件。例如,见JSFiddle

使用JQueryUI增强下拉列表:https://jqueryui.com/selectmenu/