javascript - Styling 2 different classes of jQuery UI selectmenus -


i'd have 2 different styles (classes) select menus on site. don't want use ids since there can numerous drop downs on same page.

so example:

<div class="row">   <select class="style1">       <option>option 1</option>       <option>option 2</option>       <option>option 3</option>   </select>    <select class="style1">       <option>option 1</option>       <option>option 2</option>       <option>option 3</option>   </select>    <select class="style2">       <option>option 1</option>       <option>option 2</option>       <option>option 3</option>   </select> </div> 

however, when create selectmenus javascript call:

$("select").selectmenu(); 

it doesn't transfer class name selectmenu creates (it creates id based on original 1 plus "-button").

is there way of using classes style jquery ui selectmenu?

thanks.

since new select created jquery ui follows original select in markup, able find solution using adjacent sibling selector (+).

in css:

select.style1 + .ui-selectmenu-button{} select.style2 + .ui-selectmenu-button{} 

if has alternative solution, feel free share, thanks!


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -