You must display an element ( div ) at the top of the web page. During scrolling, the item should disappear and reappear after scrolling is complete.
To add to the complexity:
- our code is guest code (thus, we cannot manipulate the structure of the DOM, etc.).
- Our code is designed to work on iPhone / iPad (Safari mobile browser).
We tried to listen for the touchstart event on the document / body and hide the element ( div ) in our selected handler. However, on some sites (when the DOM structure becomes quite complex), the scroll response time increases significantly, even if the implementation of the handler is completely empty.
We are looking for a suitable way to control the (re) element with minimal impact on the user when scrolling.
roee
source share