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 8005031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:06:08+00:00 2026-06-04T17:06:08+00:00

Is there a way to scroll to an anchor on a page when a

  • 0

Is there a way to scroll to an anchor on a page when a tab on a tabbed panel is selected? I would like the tabbed panel to scroll to the top of the browser window.

My development page is here.

The code for the anchor and tabs is:

<h1 class="heading">
    <a name="heading" id="heading"></a>Asia &amp; South East Asia International Schools
</h1>
<div id="TabbedPanels1" class="TabbedPanels">
    <ul class="TabbedPanelsTabGroup">
        <li class="TabbedPanelsTab" tabindex="0">Overview</li>
        <li class="TabbedPanelsTab" tabindex="0">Activity Weeks</li>
        <li class="TabbedPanelsTab" tabindex="0">Expeditions</li>
        <li class="TabbedPanelsTab" tabindex="0">Testimonials</li>
    </ul>

</div>

Any help would be greatly appreciated.
Cheers

  • 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-04T17:06:09+00:00Added an answer on June 4, 2026 at 5:06 pm

    You might find scrollIntoView useful.

    There are a couple of problems with using scrollIntoView:

    • It scrolls the selected element all the way to the top of the screen. It looks better if there’s a little space above the selected element, rather than having it pushed all the way to the top of the window. You can address this by combining scrollIntoView with scrollBy, which can scroll by a relative amount.
    • On your particular site some of the tabbed sections are pretty short, so, for instance, when selecting the Overview section – a short one – there’s no room to scroll the tab-panel to the top of the screen, depending on the window size. However, longer sections will scroll the tab-panel to the top. This difference in behavior doesn’t look good.

    You can implement scrollTo on your current tab-panel using something like this:

    <ul class="TabbedPanelsTabGroup">
        <li id="tabHeaderOverview" class="TabbedPanelsTab" tabindex="0" onclick="document.getElementById('tabHeaderOverview').scrollIntoView()">Overview</li>
        <li id="tabHeaderActivity" class="TabbedPanelsTab" tabindex="0" onclick="document.getElementById('tabHeaderActivity').scrollIntoView()">Activity Weeks</li>
        <li id="tabHeaderExpeditions" class="TabbedPanelsTab" tabindex="0" onclick="document.getElementById('tabHeaderExpeditions').scrollIntoView()">Expeditions</li>
        <li id="tabHeaderTestimonials" class="TabbedPanelsTab TabbedPanelsTabSelected" tabindex="0" onclick="document.getElementById('tabHeaderTestimonials').scrollIntoView()">Testimonials</li>
    </ul>
    

    Your question is tagged jquery but you don’t appear to be using it. jquery provides a much more powerful set of scrolling routines, see this jquery demo page.

    Edit: It looks like Spry has a problem with the approach above: adding an onclick event to the list elements is breaking the Spry tab-panel. I only have marginal experience with Spry, but this Spry.Utils method looks like it might be part of a Spry solution –

    You’ll need to include SpryUtils in your page, then you’d need to add javascript something like the following – sorry, but I can’t try this on my machine, so this is untested:

    function scrollTabHeader(event)
    {
        this.scrollIntoView();
        // this incorporates the scrollBy mentioned above:    
        window.scrollBy(0, -10);
    }
    
    Spry.Utils.addEventListener("tabHeaderOverview", "click", scrollTabHeader, false);
    Spry.Utils.addEventListener("tabHeaderActivity", "click", scrollTabHeader, false);
    Spry.Utils.addEventListener("tabHeaderExpeditions", "click", scrollTabHeader, false);
    Spry.Utils.addEventListener("tabHeaderTestimonials", "click", scrollTabHeader, false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to programmatically scroll to the top of a page with
Is there a way to scroll the selected node of an ASP.Net TreeView into
Is there a way to program a Scroll wheel turn on the Windows platform
Is there any way to enable horizontal scroll-bar whenever necessary? The situation was as
Is there a way to force IE7 to show a scroll bar even when
Possible Duplicate: Is there a way to hide the scroll indicators in an UIScrollView?
is there way how to get name ov event from Lambda expression like with
C-b: gives you tmux command prompt. Is there a way to scroll through the
Is there any way to measure scroll performance in an iPhone app, e.g. updates
Is there way to increase the width of the scroll bars for a DataGridView

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.