WordPress.org

Forums

Better Anchor Links
[resolved] combining Better Anchor Links and scroll script (5 posts)

  1. tomboersma
    Member
    Posted 2 years ago #

    I would like to combine Better Anchor Links and a scroll script like the one used here: http://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?

    http://wordpress.org/extend/plugins/better-anchor-links/

  2. hypeon
    Member
    Posted 2 years ago #

    I'd also like to know more about this. Did you figure out how to do it in the end?

  3. tomboersma
    Member
    Posted 2 years ago #

    No, I used it without the scroll effect.

  4. kato
    Member
    Posted 2 years ago #

    I used a combination of two plugins.
    This one, and Easy Smooth Scroll Links
    http://wordpress.org/extend/plugins/easy-smooth-scroll-links/

    They worked together right out of the box.

  5. tomboersma
    Member
    Posted 2 years ago #

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Better Anchor Links
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic