ScrollToFixed icon indicating copy to clipboard operation
ScrollToFixed copied to clipboard

minWidth cause page content to jump on iOS

Open localdog opened this issue 10 years ago • 2 comments

I use ScrollToFixed for my sites main nav. On the desktop everything works fine. I set "minWidth: 768" and when I view on iPhone, as soon as the page is scrolled all the page content jumps down 100 or so px. If I remove the "minWidth" setting this does not happen, but I don't want the mobile menu sticking on small screens. Any idea what might cause the page content to jump down like this?

localdog avatar Dec 03 '15 08:12 localdog

My first guess is, there is a hidden div that is inserted to make up for a fixed header. Since the header is not supposed to be there under 768px, the hidden div should not be there either. A media query that hides this hidden div under 768px would be a workaround and it would prove that this is the issue. Use the spacerClass option to add a class to the hidden div and user that spacerClass name to hide it in the media query. Set display: none;

Hope that works.

bigspotteddog avatar Dec 18 '15 03:12 bigspotteddog

The same issue, in desktop works fine. But when I set "minWidth", in mobile browser appear a div with some height in pixels under the header.

estebandinamarca avatar Feb 24 '17 19:02 estebandinamarca