combining Better Anchor Links and scroll script
-
I would like to combine Better Anchor Links and a scroll script like the one used here: https://ngnf.no/medlemsbedrifter/ (click on one of the links at the top of the page contents to see what I mean).
This works by adding the following script:
<script type='text/javascript'> jQuery(document).ready(function($) { $(".scroll").click(function(event){ event.preventDefault(); $('html,body').animate({scrollTop:$(this.hash).offset().top}, 500); }); }); </script>
and adding a class=”scroll” to all the anchor links.
I would like to make this same effect work in combination with Better Anchor Links but that doens’t seem to work. What I did is the following:
- add the script to each page
- hack the plugin so that each link gets a class=”scroll”
Nothing happens. Anyone a clue?
https://www.ads-software.com/extend/plugins/better-anchor-links/
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘combining Better Anchor Links and scroll script’ is closed to new replies.