lundi 10 juin 2019

Issue with scrollTop on iOS Safari

I have a "Back To Top" button on my website which gets show when the user has scrolled down a bit and I also want to hide it, when the footer appears (as it overlaps with the links on the footer). Unfortunately, all methods I tried, did not work on Safari of iOS, (because of the Action Bar, I assume). It works fine if the action bar is shown, but does not work if it is hidden.

I have tried different approaches, however, I am not quite sure I understand well what is in the core of the issue, so I cannot seem to find a fix for the problem.

I am currently using: (document.documentElement.scrollHeight - document.documentElement.scrollTop) - footerHeight <= document.documentElement.clientHeight) to check the scroll position of the page.

Any help would be appreciated.




Aucun commentaire:

Enregistrer un commentaire