2016-09-23 51 views
0

有什麼方法可以在搜索框外顯示select2選定項目嗎?
我現在有:
這裏是一個示例fiddle
enter image description here
但我想:
enter image description here在搜索框外顯示select2多項選擇

.select2-search-choice{ 
    width:100% 
} 
<select multiple id="e1" style="width:300px"> 
    <option value="AL">Alabama</option> 
    <option value="Am">Amalapuram</option> 
    <option value="An">Anakapalli</option> 
    <option value="Ak">Akkayapalem</option> 
    <option value="WY">Wyoming</option> 
</select> 
+0

IM肯定有,如果有HTML和CSS這裏 – Keith

+0

@Keith我,會令該:) – osyan

+0

@Keith這裏演示的是小提琴http://jsfiddle.net/ q2hp451y/2/ – osyan

回答

1

現在你有它設置爲溢出:隱藏;.通過繼承來解決這個問題,然後設置你想要你的答案走多遠。

http://jsfiddle.net/q2hp451y/3/

.select2-search-choice{ 
    width:100% 
} 

.select2-container-multi .select2-choices { 
    overflow: inherit; 
} 

.select2-container-multi .select2-choices .select2-search-choice { 
    top: 30px; 
    width: 270px; 
} 
+0

不錯:)謝謝你,你救了我的一天 – osyan

+0

隨時我的朋友 – Keith