Issue
I'm trying to do a back to top
button but to scroll down and up to a certain point on the page. For instance you have a long text and you want to bring the user to the next paragraph by simply having them to click on a link... I've done it in the past but I can't remember how I did it for the life of me...
Solution
What you would want to do is put an "anchor" at the top of the page, using an <a>
tag (it's not JUST useful for links!). Then, when you have a link that goes to #nameofanchor
, it scrolls to the anchor with that name. You'd do it like this:
<a id="top"></a>
<!--content here-->
<a href="#top">Back to top</a>
Here is a working jsfiddle: http://jsfiddle.net/qf0m9arp/1/
Answered By - markasoftware
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.