New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Page scrolls to top when opening modal without # navigation #7
Comments
You use hash tracking, you just call it without hash =). Write this to disable it: <div class="remodal" id="modal_test" data-remodal-id="test"
data-remodal-options='{ "hashTracking": false }'>
<!-- load dynamic content -->
</div> The page scrolls back to the top, because of the native behavior of any browser. Your link has an id attribute 'test', when the hash changes to '#test', it scrolls back to the anchor with a 'test' id. By the way, it is the reason, why i've added 'data-remodal-id' instead of 'id' attribute. |
But yes, thanks, i've tested it, it has a wrong behavior. I found that a page scrolls to the top, when closing modal, i've broken something. I will fix it soon. |
Thanks for your fast response appreciate it, really like your plugin! Already had disabled the hashtracking in de remodal.js file. And now using rel instead of id but still when opening the modal it scrolls back to the top not just when closing the modal. |
OK, will be fixed. |
In the script there is a piece of code that goes like this at the very end of this script (location.hash = "";) just add "id" in between the quotes, and it will save the current scroll position so it looks like this:
|
Thanks for your tip but it doesn't seem to work it just puts #id at the end of the url instead of # |
Even when I don't use the hashTracking function the page scrolls back to top when open the Remodal window, is there a way to fix this ?
The code:
The text was updated successfully, but these errors were encountered: