简体   繁体   中英

how to change selected value color in select box in jQuery Mobile?

I need to know how to change the selected value colori n select box in jQuery Mobile in iPad? Currently, it's ok in native Safari browser. When I render it in iPad Safari browser, it doesn't work.

Please check the following Image. I want to change different color to "Pink NRIC" when selected instead of white color.

在此处输入图片说明

Now I know how to change the color of selected combo in jQueryMobile. Here is the solution.

The first part is I need to add new class name for active select box in stylesheet.

ui-select-active {color:#0000a0; text-shadow: 0 -1px 1px #ffffff;}

After that, I need to declare above class name in jQueryMobile javascript file.

We need to add following coding after this "activeBtnClass: "ui-btn-active","

activeSelectClass: "ui-select-active",

Final part is we need to change existing coding in line 3491.

/* original coding */
button.addClass( $.mobile.activeBtnClass );

/* change to this one */
button.addClass( $.mobile.activeSelectClass );

Change jQueryMobile Select Box active style color in iPad safari

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM