I'm new to js/jquery mobile, and I've been trying to create a complex example to improve my skills.
I have a JQM Accordion , grouping listviews with one checkbox per line on each "collapsible" div. What I want to do is use a dynamic Navbar to "Mark/Unmark" all checkboxes from the active listview. Example:
I've been able to create the whole thing after a lot of research, and this is what I came up with: http://jsfiddle.net/mauriciorcruz/2zgt8/ .
My issue is that the
$('#navbar-footer').show();
$('#navbar-footer').hide();
stops working as expected after some checkbox clicks in different groups.
I've searched a lot for the answer, but it seems I'm not having enough skills to even understand the issue. My guess is that it's something related to how I'm implementing the handlers, as my implementation fully works while debugging .
Any help is appreciated.
Thank you!
the problem have something to do with the tapToggle of jquery-mobile you can fix it adding the data-tap-toggle="false" on the footer like this
<div data-role="footer" data-tap-toggle="false" data-position="fixed" id="index-footer">
or in the $(document).ready like this
$("[data-role=footer]").fixedtoolbar({ tapToggle: false });
the footer won't toggle on screen tap but it will work on your functions
http://jsfiddle.net/2zgt8/2/
if you want to keep the tapToggle you need to add e.stopPropagation() on your click handlers like this
$('#index-footer').on('click', '#mark-all', function(e) {
e.stopPropagation();
//...
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.