Solution
Here's a solution for you, I had a spare time so here it is: http://jsfiddle.net/Gajotres/ek2QT/
Javascript code:
First on pagebeforeshow select/unselect our custom checkboxes.
$('#index').live('pagebeforeshow',function(e,data){
$('input[type="checkbox"]').each(function(){
($(this).is(':checked')) ? $(this).parent().parent().addClass('checked') : $(this).parent().parent().addClass('not-checked');
});
});
This part will handle checkbox changing states.
$('.checkBoxLeft').bind('click', function(e) {
if($(this).find('input[type="checkbox"]').is(':checked')){
$(this).removeClass('checked').addClass('not-checked');
$(this).find('input[type="checkbox"]').attr('checked' , false);
} else {
$(this).removeClass('not-checked').addClass('checked');
$(this).find('input[type="checkbox"]').attr('checked' , true);
}
});
Rest off the css is in the example, img used for custom states can be found here:
Final notes
If you want to find more about how to customize jQuery Mobile page and widgets then take a look at this article. It comes with a lot of working examples, including why is !important necessary for jQuery Mobile.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…