JqueryMobile用图像替换单选按钮

时间:2012-11-28 10:32:35

标签: jquery jquery-mobile

我正在使用jquerymobile为网络应用创建一个广播组。用户必须在“男性”和“女性”之间进行选择。我有点击(触摸)性别的图像和未点击的图像。我想用两个有两种状态的图像替换无线电组。 我该怎么做?

1 个答案:

答案 0 :(得分:3)

我在这里给你举了一个例子:http://jsfiddle.net/Gajotres/EeRXd/

$('div[data-role="fieldcontain"] fieldset  div div:first-child label span span').html('<img src="http://cdn1.iconfinder.com/data/icons/Snow/Snow/snow/Male.png" width="32px" height="32px"></img>');
$('div[data-role="fieldcontain"] fieldset  div div:last-child label span span').html('<img src="http://cdn1.iconfinder.com/data/icons/Snow/Snow/snow/Female.png" width="32px" height="32px"></img>');

如果你想要别的东西,请在评论中告诉我,如果你有一个每个州的图像给我一个位置,我会重建你这个例子。

相关问题