Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7963391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:35:52+00:00 2026-06-04T05:35:52+00:00

Using scrollTo and localScroll to navigated around a page and need to identify which

  • 0

Using scrollTo and localScroll to navigated around a page and need to identify which link was clicked for use in a callback function. I’ve dug around the source of each and am unable to understand how to extract it.

What I’ve found for sure is that $(this) refers to the body element in its entirety. Thanks for your help!

Here’s my function:

$('nav').localScroll({
    duration: 500,
    easing:'easeOutSine',
    axis:'xy',
    onAfter: function(){
        /* This is where I need to identify the anchor that was clicked*/
        var test = $(this);
        console.log(test);
    }
});

HTML:

<nav>
  <ul>
    <li><a href="#one" class="active">One</a></li>
    <li><a href="#two">Two</a></li>
    <li><a href="#three">Three</a></li>
    <li><a href="#four">Four</a></li>
    <li><a href="#five">Five</a></li>
    <li><a href="#six">Six</a></li>
  </ul>
</nav>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:35:54+00:00Added an answer on June 4, 2026 at 5:35 am

    With enabled hash option this could be useful: JQuery > ScrollTo > highlighting the item that was scrolled to.

    Other solution is adding another click event to all links and setting variable/attribute which you could read later inside onAfter callback.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a multi-section splash page using jQuery scrollTo to navigate between sections. There's
I am using the jQuery scrollTo plugin as you can see on the page
I'm using the JQuery scrollTo plugin on our one-page site to vertically scroll between
I have a page with two scroll bars. I am using the scrollTo jquery
I'm using the One Page Navigation Plugin which allows for one menu to control
using jQuery and the scrollTo function, is it possible to scroll a certain amount
I've got a page with an iframe . The iframe is using jquery.scrollTo to
When using the scrollTo function (a member of the slideView object), is it possible
I'm working on a project and using Ariel Flesler's jquery.scrollTo.js & jquery.localScroll.js ... I
I'm using window.scrollTo('#body') for scrolling to the top of the page but its quite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.