Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery mobile-以编程方式更改单选按钮颜色_Jquery_Jquery Mobile - Fatal编程技术网

jquery mobile-以编程方式更改单选按钮颜色

jquery mobile-以编程方式更改单选按钮颜色,jquery,jquery-mobile,Jquery,Jquery Mobile,我正在使用jquery确定是否选择了jquerymobileradio按钮。如果是,我想更改背景色。这将成功添加选中的属性: if (row['cur']=="£") { $('#cur2').attr('checked', 'checked'); } 但是背景色不会改变 我尝试过像这样改变css $(".ui-radio:nth-child(1) .ui-radio-on span.ui-btn-inner").css('background-color', '#ffffff'); 但这也

我正在使用
jquery
确定是否选择了
jquery
mobile
radio
按钮。如果是,我想更改
背景色
。这将成功添加
选中的
属性:

if (row['cur']=="£") {
$('#cur2').attr('checked', 'checked');
}
但是背景色不会改变

我尝试过像这样改变css

$(".ui-radio:nth-child(1) .ui-radio-on span.ui-btn-inner").css('background-color', '#ffffff');
但这也不起作用-任何想法请选择下一个
,然后选择它的
子项:

$('#cur2')
    .next('label')
    .children('span')
    .css('background-color', 'red');

通过编程更改复选框/单选按钮时,必须刷新该复选框/单选按钮

$('#cur2').prop('checked',true).checkboxradio('refresh');

为什么要设置选中的单选按钮来更改其背景色?为什么不调用
$('cur2').css('background-color','ffffff')对不起,我应该说得更具体一些-当单选按钮位于水平组中时,它是按钮的背景色-这是您想要的吗@Phillbarnett它在演示中起作用,那么你有什么不同的做法?如果可能的话,发布一个小提琴,显示它不工作。我有一个多页jquery移动布局。如果我将无线电组放在第一页并使用body onload触发jquery代码,我可以成功复制您所做的工作。但是,我的广播组需要进入第二页>我尝试用$('quote')触发它。live('pagecreate',function(event){/});-它似乎不起作用