Skip to content Skip to sidebar Skip to footer

Bootstrap Popover Wont Close In Mobile

I have simplified my html to the code I post here. First I have an empty p-tag. Then a table-tag containing a popover-anchor. And then another empty p-tag. When I am on Desktop, af

Solution 1:

The problem is that on Iphone onclick on the body element doesnt work. Try to code a simple html-page where you have this code: $(function () { $('body').on('click touchstart', function (e) { alert("clicked"); }); }); Well, on Iphone there will not be any alert. So focusing on that, I discovered that there are a few workaround to this. One workaround is to have a css-directive on the element you want to be clickable (in my case all the body-tag, so in that cse you may want to put some wrapper envolping all the body-content). The directive is simply: cursor:pointer;

As you probably dont want all the elements to show the pointer, you probably will need to detect if the client was iOS.

Post a Comment for "Bootstrap Popover Wont Close In Mobile"