For mobile devices how can I temporarily prevent jQuery touch events while
I am waiting for a JSON response?
For mobile devices how can I temporarily prevent jQuery touch events on a
page while I am waiting for a JSON response?
The JSON response will be used to create and update content on the page
but there are other elements with event handlers that I'd like to disable
(or stop users from activating them) until the JSON response has come back
and I have done the necessary adjustments to the page content.
With my limited experience I am considering two methods.
(1) I am considering creating or activating an overlaying div that
prevents jQuery event listeners on elements under the overlay from
detecting touch events. Something like a mobile version of
pointer-events:none; however I cannot find the mobile equivalent of
pointer-events:none;
(2) The other method I am considering is an Object that keep track off all
listeners and on command turns them .off() then once the JSON and
adjustments have finished I can re-attach them .on('click') however this
seems excessive if I can achieve what I want with the first method.
No comments:
Post a Comment