I’m working on a single page Joomla site. It’s very basic, but I’m having some technical difficulties. When the user clicks a link in the nav menu, the page scrolls to the corresponding element. I’m doing this through jQuery and plain old anchors. (example: mysite.com/#contact)
I’m also using a contact form. When I submit this form the page reloads. I want to reload the mysite.com./#contact url again and I also want to show a message to the user to let him/her know that the form has been submitted successfully. I don’t want to use a popup for this, but I want it to show just above the form.
I thought of having the submit redirect back to mysite.com/#contact?submit=yes and then use jquery to check if the url has the submit=yes parameter and display the message, but the problem is that if I pass parameters through the url, it doesn’t automatically scroll down to the correct element…
Does anyone have any ideas/clever tricks to fix this?
Thanks in advance!
Bram
Try putting the parameters first, then the anchor at the end.
mysite.com/?submit=yes#contact