ajbee
ajbee

Reputation: 3641

How to change highlight color in Jquery Mobile Select Option

I have this select option

enter image description here

Is it possible to change the highlight color from skyblue to other color?

I'm using jquery.mobile-1.4.5.min.js/css

Note: I'm also trying to edit in developer tools but I can't find any editable element.

Upvotes: 1

Views: 1274

Answers (2)

Homen
Homen

Reputation: 1212

You should not do this.It is default behaviour of dropdown.There are some methods to do this.But these are not working in all browsers. Better convert your <select> to <ul><li> format and do whatever you want.

Otherwise,use jQuery Mobile data-native-menu="false" property of dropdown :

<select id="selectID" data-native-menu="false">
  <option value="one">One</option>
  <option value="two">Two</option>
  <option value="three">Three</option>
  <option value="four">Four</option>
</select>

And use following css :

 .ui-selectmenu-list .ui-btn-active {
    background-color: green !important;
    border-color: green !important;
    }

Upvotes: 3

Joe
Joe

Reputation: 2540

Yes, the class you need to modify is ui-state-active

Ex:

.ui-state-active {
   background: red;
}

Upvotes: 1

Related Questions