I am looking to swiperight on jQuery Mobile to highlight the list and check the hidden checkbox within. And when I swiperight again, it will reverse the action. Here's what I gathered so far:
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