Note that there are some explanatory texts on larger screens.

plurals
  1. POClicks/taps are passing through absolute positioned divs in JQuery Mobile
    text
    copied!<p>I'm not sure if anyone else has experienced this in JQuery Mobile, but for some reason I can't prevent elements underneath my absolute positioned DIVs and fixed header from intercepting clicks/taps on mobile devices.</p> <p>For example, I have a page that lists contacts in a long scrolling list. On that page is a floating header with a button. If I scroll the list downward and click on the floating header's button, the click will pass through to whatever contact is underneath the header, even though it cannot be visually seen because it is underneath the header.</p> <p>If I click on a button in the header, the button never triggers - the list element underneath it always fires. If I scroll the list so that there is nothing underneath the header, however, I can click the header's button normally.</p> <p>So far I've tried: - event.stopPropagation() on the header's button. This never even fired, however. The element underneath always steals focus</p> <ul> <li><p>Detecting the click event's Y coordinates. If the coordinates are less than the height of the floating header, abort the click action. This didn't work either, however - after I did "return true;", the button's click handler never fired.</p></li> <li><p>Setting z-indexes on the floating header and list item container, even though they are already visually correct.</p></li> </ul> <p>I'm quite stumped. I tried to make a testbed but it works correctly there. It also works correctly on the JQM demo site, so it must be something about my app's CSS or structure. I can't think of what would cause floating elements to show correctly but only be tappable when nothing else tappable is underneath them.</p> <p>Any ideas would be appreciated!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload