Reputation: 505
At the moment, I am learning how to write in javascript and jquery. I am wondering if there are any alternatives that can be used to scroll through (up/down) classes which are in a div (Not the whole body). Thank you in advance for the help.
PS: I tried to use ScrollTop
but for some reason (I have no idea why) after refreshing the page on Firefox, IE and Edge the script starts to act really weird. For example, if I press button A to scroll to a class called "A" after the refresh when I press the button A it goes to class "C", for example.
PSS: The alternative method can be in javascript or jquery. Doesn't matter.
Best regards,
George S.
Upvotes: 0
Views: 744
Reputation: 440
If you want an alternative you can use internal links. For use this HTML feauture you set a name attribute to the content section header where you want to scroll like this:
<a name="aDiv">A Section</a>
and set the href attribute to the ancor link like this:
<a href="#aDiv">Go to A Section</a>
This is another approach and must be integrated with CSS for getting the result that you want.
Upvotes: 2