robb0wen / tornis

Tornis helps you watch and respond to changes in your browser's viewport 🌲
https://tornis.robbowen.digital
MIT License
1.58k stars 35 forks source link

Document height not correctly detected if used in Wordpress (and a workaround) #20

Closed meksone closed 1 year ago

meksone commented 2 years ago

First of all, thanks for this library, it is what I need for a little project :)

I'm integrating Tornis in Wordpress, and for testing I've imported the entire demo page in Elementor. All is working fine, except for document height, that's not correctly detected on first load of page (value = 0). It will be detected ONLY if you resize the window after loading, or zoom in/out. I've tried to disable all the non essential js on Wordpress, but nothing changes.

The only workaround I've found is to modify the code and use jQuery ( document ).height(); to pass the correct value. It's not a big problem and I don't know if it's related to how Wordpress renders the page, but maybe is a little thing that can be fixed :)