Skip to content Skip to sidebar Skip to footer

Bootstrap3 Accordion Table Not Working On Ios Mobile

I have an accordion table working fine on all devices and browsers but not working at all in ios mobile. the solutions I found are only for div's and using href but in my case I re

Solution 1:

I've run into issues with iOS and bootstrap as well.

For some reason if you manually attach the click event to the tr elements it works without and issue but you can not pass the additional attribute to the selector.

http://jsfiddle.net/8x3ub2xz/

Seems to only have trouble attaching the click event when there are additional attributes passed to the selector? No idea why.

THIS WORKS

$(document).ready(function () {

    $("tr").click(function () {
        var sender = $(this);
        var targetId = $(sender.attr("data-target"))
        targetId.toggle().collapse();
    });

});

THIS DOES NOT

$(document).ready(function () {

    $("tr [data-toggle='collapse']").click(function () {
        var sender = $(this);
        var targetId = $(sender.attr("data-target"))
        targetId.toggle().collapse();
    });

});

Post a Comment for "Bootstrap3 Accordion Table Not Working On Ios Mobile"