2012-04-20 62 views
0

当我尝试使用selectmenu jquery插件同时删除或隐藏select($('option').hide())中的选项时,它仍会显示我想要删除的选项。删除selectmenu后,我会看到通常的HTML下拉选择,它有选项删除。我究竟做错了什么?如何在jquery selectmenu插件中隐藏一个选项

+1

任何源代码? – sp00m 2012-04-20 13:09:11

回答

2

假设您要更改或删除选项。

你可以尝试与演示页 http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/index.html 通过Firebug的控制台或任何similiar:

$("select#speedC").find("option:first").remove(); 
//and then you can refresh with 
$("select#speedC") 
.selectmenu("destroy") //destroy the custom select menu 
.selectmenu({style:'dropdown'}); //replace with the new custom select menu 

这不是最好的选择,但刷新看来,这是行不通的。

让我知道。 Donato。