简体   繁体   English

如何在jQuery Mobile的选择框中更改选定值的颜色?

[英]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? 我需要知道如何在iPad的jQuery Mobile中更改选择值colori n select框吗? Currently, it's ok in native Safari browser. 目前,在本机Safari浏览器中可以。 When I render it in iPad Safari browser, it doesn't work. 当我在iPad Safari浏览器中渲染它时,它不起作用。

Please check the following Image. 请检查以下图像。 I want to change different color to "Pink NRIC" when selected instead of white color. 我想在选择时将其他颜色改为“粉红色NRIC”,而不是白色。

在此处输入图片说明

Now I know how to change the color of selected combo in jQueryMobile. 现在,我知道如何在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. 之后,我需要在jQueryMobile javascript文件中声明上述类名。

We need to add following coding after this "activeBtnClass: "ui-btn-active"," 我们需要在此“ activeBtnClass:“ ui-btn-active”,“之后添加以下代码

activeSelectClass: "ui-select-active",

Final part is we need to change existing coding in line 3491. 最后一部分是我们需要更改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 在iPad野生动物园中更改jQueryMobile Select Box活动样式的颜色

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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