jomla Posted September 25, 2016 Share Posted September 25, 2016 (edited) Hi at all in my web site www.iomla.net I have an accordion menu animated by this script:www.iomla.net/acc.js.It work very well but clickin into an item not containing final link the page (if is zoomed) scroll to top instead of staying steady waiting for next choice or open folder.It'ld can scroll the page to top only clicking last choice containing link to page that is a function. Scroll is very harmful with smartphones and tablets Thank you very much Edited September 25, 2016 by jomla Link to comment Share on other sites More sharing options...
justsomeguy Posted September 26, 2016 Share Posted September 26, 2016 It scrolls to the top because you have the link href set to "#". Your Javascript function that handles the clicks should cancel the default action. Link to comment Share on other sites More sharing options...
jomla Posted October 2, 2016 Author Share Posted October 2, 2016 Thank youI inserted src="javascript:void(0);" instead of src="#" and page do not scroll more. But I have also some buttons that do scroll the page on click like this: <form onsubmit=" return myFunction();"> <input type="submit" value="click to display history" style="width:100%;"> </form> What can I change into buttons? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 3, 2016 Share Posted October 3, 2016 Does myFunction return false? If not then the form will submit and the page will refresh. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now