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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:31:29+00:00 2026-05-30T02:31:29+00:00

i have problem with my code. I use this JS $(document).ready(function() { //Default Action

  • 0

i have problem with my code.

I use this JS

$(document).ready(function() {
//Default Action
  $(".tab_content").hide(); //Hide all content
  $("ul.tabs li:first").addClass("active").show(); //Activate first tab
  $(".tab_content:first").show(); //Show first tab contentDocument

//On Hover Event
  $("ul.tabs li").hover(function() {
     $("ul.tabs li").removeClass("active"); //Remove any "active" class
     $(this).addClass("active"); //Add "active" class to selected tab
     $(".tab_content").hide(); //Hide all tab content
     var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
     $(activeTab).fadeIn(); //Fade in the active content
     return true;
  });
});

When I hover over a tab, the content is changed, but the browser scrolls the page to the top.
I would like to have – When i hover over a tab, page remains in its current scroll position and content is updated.

  • 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-30T02:31:30+00:00Added an answer on May 30, 2026 at 2:31 am

    The problem is happening because when you perform the hide() the page height is decreased forcing the browser the scroll to the top of the page (ie no scrolling is needed to show the whole page). Give your container div : <div class="tab_container"> a height.

    Tested on your site using firebug and prevents the scrolling – set the height of the <div class="tab_container"> to 500px for example – this fixes the problem … is the content variable height ?

    You could also use the min-height css property.

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

Sidebar

Related Questions

My current code that i use is this: <script type=text/javascript> $(document).ready(function(){ $('#on_holiday').trigger('click'); }); </script>
I have a problem with this Jquery function. The the simplifide code looks like:
I have the following jQuery code that works: $(document).ready(function () { $(input[id^='pos_']).change(UpdatePosition) }); function
I have a problem in php code inserting values into database (I use PHPMyAdmin).
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem with this code: file = tempfile.TemporaryFile(mode='wrb') file.write(base64.b64decode(data)) file.flush() os.fsync(file) # file.seek(0)
Hi i have problem with this code, i found it on the internet and
i am a beginner and i have a problem : this code doesnt compile
I have an ASP .NET page where I use jQuery. I used this function
have a problem with my ajax code. I have some links and a content

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.