trick like scrollIntoView (center of div)
itsDantes opened this issue · comments
hello guys, it may help you to scroll into center of div like scrollIntoView center option.
div_id = "#mydiv"; $(document).scrollTo($( div_id )[0], 1000, {over: 0.5, offset: -$(window).height() / 2 } );
by this, the screen will auto going to middle of div. tested in mobile and works fine. bye.
Hi @BehroozDante, great! FYI you replace $( div_id )[0]
for div_id
.
I will close this, though, as it's not quite an issue. Seems more suited for stack overflow (as suggestion) or some sort of wiki.
Thanks for the contribution!