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

  • SEARCH
  • Home
  • 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 7074631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:04:51+00:00 2026-05-28T06:04:51+00:00

I have 2 issues with my tabbed content. 1.How would I highlight the current

  • 0

I have 2 issues with my tabbed content.

1.How would I highlight the current tab using my code:

http://jsfiddle.net/FznTg/2/

2.I’ve added return false, but it still goes to the top of the page when you click a menu item (To see this, resize the viewing window and click a tab.

again: http://jsfiddle.net/FznTg/2/

Really do hope someone can assist.

  • 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-05-28T06:04:52+00:00Added an answer on May 28, 2026 at 6:04 am

    You can fix the scrolling issue by putting the .show() or new content before the .hide() of old content. This keeps the document from ever being so small that scrolling is not needed, thus resetting the scroll position.

    So, put it in this order:

         //fix
         if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0") {
             jQuery('.tabcontent#' + stringref).show();
         } else {
             //display our tab fading it in
             jQuery('.tabcontent#' + stringref).fadeIn();
         }    
    
         //hide the tabs that doesn't match the ID
         jQuery('.tabcontent:not(#'+stringref+')').hide();
    

    Working demo here: http://jsfiddle.net/jfriend00/E8Jgd/

    For setting the style of the current tab, you should just add a class to the current tab which you can then style using CSS. Putting this line in your click handler will set the current tab to have a class=”current” and remove that class from any other tabs:

    jQuery(this).closest("li").addClass("current").siblings().removeClass("current");
    

    You can then style it with CSS like this:

    .hometabs li.current a {color:red;}
    

    And, you can than add the class to the HTML for the first tab by default:

    <li class="current"><a href="#tab1">All</a></li>
    

    Demo here: http://jsfiddle.net/jfriend00/E8Jgd/

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

Sidebar

Related Questions

I have a Magento site using JS (prototype) to display tabbed content on product
We have issues within an application using a state machine. The application is implemented
I have issues to build a project using external libraries with Visual Studio 2010
I have issues understanding scopes in javascript.Let's suppose i have the following code: Ext.define('MA.controller.user',{
I have a jQuery tabbed search script that gets content from a PHP file
I have a 'tabbed' style web page where once the page loads each tab
I have a tabbed application and when I click on the second tab, an
I have issues with using the MyISAM engine in my database. It is constantly
I have issues with the following code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include
I've just started using LevelScheme , and have issues with getting the histogram to

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.