Currently in the process of creating a basic front end website with Bootstrap for styling. One section I've developed includes modals, where users click a button to open a centrally located modal window.
Desired Functionality
I aim to enable users to click a button within the modal that redirects them to another part of the page while simultaneously closing the modal.
To achieve this, I have successfully used <a>
tags, as well as href and id attributes to guide users to the intended location on the page. Additionally, I incorporated
onclick="window.location.href='#middle'"
for redirection purposes.
The Issue arises when users click the button on the modal. After being redirected and the modal closes, the window quickly reverts back to the original position where the button was initially pressed.
My objective is to prevent this automatic return to the initial modal trigger point and ensure users remain at the new destination they clicked on.
Although I tested using <a>
instead of <button>
, the issue persisted.
An interactive demonstration displaying the problem can be found on jsfiddle:
https://jsfiddle.net/peamanschesthair/kdu5gno1/42/
All suggestions and solutions are welcomed and appreciated.