我想爲自定義樣式的選擇框使用腳本,並且因爲我需要在選擇框之一中有足夠的條目,但我在創建滾動功能時被卡住了(一個腳本來計算數字項目,如果它在X上,那麼需要將一些Overflow屬性改爲腳本創建的UL。)對此的任何解決方案?自定義樣式的選擇框
1
A
回答
1
沒有這種溢出控制的直接選項,瀏覽器會自動管理文檔高度。
爲了做到這一點,您可以使用jQuery Dropdown Replacement並從您擁有的鏈接應用皮膚。
1
有一個很好的方法來做到這一點! ^^我做到了幾秒鐘前)
HTML
<div class="styledSelect">
<span class="styledSelectValue"></span>
<select name="type">
<option value="">Par type de propriété</option>
<option value="choix2">choix2</option>
<option value="choix3">choix3</option>
</select>
</div>
CSS
.styledSelect{/*your css for the background image... it will be the body of your select*/}
.styledSelect select{/*your css with opacity:0;*/}
.styledSelectValue{/*the css of the received value*/}
jQuery的
$('.styledSelect').each(function(){
selectValue = $(this).children("select").val();
if(selectValue == ""){selectValue = $(this).children("select").children("option:eq(0)").text();}
$(this).children(".styledSelectValue").text(selectValue);
});
$('.styledSelect select').change(function(){
selectValue = $(this).val();
if(selectValue == ""){selectValue = $(this).children("option:eq(0)").text();}
$(this).parent(".styledSelect").children(".styledSelectValue").text(selectValue);
});
這是我找到的最好的方式;)
相關問題
- 1. 自定義樣式的選擇框
- 2. Bootstrap選擇的自定義樣式
- 3. WPF的自定義複選框樣式
- 4. 自定義複選框樣式
- 5. 自定義選擇框
- 6. jquery:自定義選擇框?
- 7. 自定義選擇框
- 8. 自定義jQuery選擇框
- 9. Silverlight樣式:基於自定義樣式的自定義樣式
- 10. 對話框複選框上的自定義樣式
- 11. 密碼框IsPasswordRevealButtonEnabled顯示自定義樣式的複選框
- 12. WPF Xaml自定義樣式列表框中選定的項目樣式
- 13. Android的對話框自定義樣式
- 14. Silverlight的列表框自定義樣式
- 15. 自定義ListView複選框選擇
- 16. 如何自定義選擇這樣
- 17. 基於視圖的自定義選擇樣式的NSOutlineView
- 18. 從md-tab自定義未選擇的md-tab-label的樣式
- 19. 自定義選擇對話框的TextView
- 20. 自定義字段選擇框WordPress的
- 21. 選擇框的自定義CSS
- 22. IE8的自定義選擇框
- 23. drupal中的自定義選擇框
- 24. 選擇正確的控件(TabControl,ListView,列表框,按鈕) - WPF自定義樣式
- 25. 處理基於視圖的自定義選擇樣式NSTableView
- 26. 深度選擇器的自定義樣式mixin
- 27. Select2 - 多選自定義格式選擇
- 28. 一個自定義組合框樣式
- 29. 樣式化自定義對話框
- 30. 自定義組合框樣式錯誤