Open andyvalerio opened 4 years ago
Sorry, I've only just seen this. For some reason I'm not getting notifications for new issues.
I agree there needs to be a different calculation for mobile window dimensions. I'll do a bit more testing and what happens. Pull requests are welcome.
Hi, no worries! A few months have gone but I actually ended up using this in production, I modified it a bit like I said mainly using document.body.clientWidth and with a bit of hardcoding here and there if I recall correctly. It does its job anyway, I'm grateful you created this.
I don't have much time over lately so I won't be able to create a proper pull request (I did sent a little donation instead, to clean my conscience :'D) and if you think it can be useful I can send you the file I changed "as is".
Much appreciated. I'm glad you find the lib helpful. If you you can send me the changes you made it'll help!
Hi Mobius1, thanks a lot for creating this! I'm playing with it these days and I started wondering about the window size. I see that you are defining it using the window's inner dimensions: width: window.innerWidth, height: window.innerHeight
I wonder whether, especially for mobile, it wouldn't be better to use something else. For example I'm getting more consistent results using the body's dimensions: width: document.body.clientWidth, height: document.body.clientHeight
The issue with using window's dimensions on mobile is that most of the time part of the window is covered by the address bar (on Chrome at least) and even using innerWidth/innerHeight as you are doing, it doesn't seem to consistently return the available space, but rather the dimensions of the whole window. At least for me this makes the content quite often look not centered and it even goes out of the view.
Would you consider making this configurable somehow?
Again, thanks a lot for this library.