【发布时间】:2012-02-22 12:06:54
【问题描述】:
我希望在 jQuery Mobile 上向右滑动以突出显示列表并选中其中隐藏的复选框。当我再次向右滑动时,它会反转动作。以下是我目前收集到的内容:
HTML:
<ul data-role="listview">
<li><a href="#resultPage">Deals<input type="checkbox"/></a></li>
</ul>
CSS:
input[type="checkbox"]
{
display:none;
}
jquery:
$(document).ready(function() {
//Swipe
$("#searchPage li").live('swiperight', function(){
if($(this).children(':input:checkbox').is(':checked')){
$(this).css('background','orange');
$(this).children(':input:checkbox').click();
}else{
$(this).css('background', '');
$(this).children(':input:checkbox').click();
}
}
});//END ready
【问题讨论】:
标签: css input jquery-mobile checkbox swipe