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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:20:02+00:00 2026-06-05T02:20:02+00:00

Issue is only with Safari: I have three tabs that each show a div

  • 0

Issue is only with Safari: I have three tabs that each show a div id while hiding the other two. If I click tab2 then tab3 then tab1 it shows/hides the proper divs without the screen scrolling up, however when I then click either tab2 or tab3 from tab 1 it moves the screen up to the top of the referenced div. Can anyone think of why this may be the case and how to solve it? I would like the divs to show/hide without the screen scrolling up after clicking the tab. Thanks!

Here is the HTML Code:

`

<a onClick="remove_visibility('tabs2'), remove_visibility('tabs3'), toggle_visibility('tabs1')">Tab 1</a> 


<a onClick="remove_visibility('tabs1'), remove_visibility('tabs3'), toggle_visibility('tabs2')" class="selected">Tab 2</a> 


<a onClick="remove_visibility('tabs1'), remove_visibility('tabs2'), toggle_visibility('tabs3')">Tab 3</a>

`

Here is the relevant jQuery code:

 <script type="text/javascript">
toggle_visibility = function (id) {
    var e = $("#"+id);
    e.show();
}
remove_visibility = function (id) {
    var e = $("#"+id);
    e.hide();
}


</script>
  • 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-05T02:20:04+00:00Added an answer on June 5, 2026 at 2:20 am

    I would not use onclick with JQuery calls I would attach them via their anchor id, class or by type or some other way. Try also in those functtions returning a false after you show and hide may be that will do the trick, cause Im thinking its trying to navigate some where because you clicked an empty anchor.

    Update:

    I have some code that does it and the html is at the bottom of the page with scroll position of the browser being at the bottom and wont navigate up:

    JQuery (This is a quick mock-up based on my HTML, to give as demo, customise it to your needs and how you would grab items and how):

    <script type="text/javascript">
        $(document).ready(function() {
            $(".divClass a").each(function(i) {
                if ($(this).text() != 'Tab 2') {
                    $(this).next().hide();
                }
                $(this).click(function() {
                    $(".divClass a").each(function(i) {
                        $(this).next().hide();
                    });
                    $(this).next().show();
                    return false;
                });
            });
        });
    </script>
    

    HTML (again some thing quickly put together for a demo):

    <div class="divClass">
        <a href="JavaScript:void();">Tab 1</a>
            <div id="Tab1">
                I am Tab 1 
            </div>
        <a href="JavaScript:void();">Tab 2</a>
            <div id="Tab2">
                I am Tab 2 
            </div>
        <a href="JavaScript:void();">Tab 3</a>
        <div id="Tab3">
                I am Tab 3 
            </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue that only seems to affect Safari and Chrome (aka WebKit).
I have a very strange issue that only affects webkit browsers for some reason,
I've been investigating this issue that only seems to get worse the more I
I'm trying to debug an issue that only occurs when my iPhone app receives
I'm using Intelligencia UrlRewriter for URL Rewriting, the only issue I have is trailing
I'm debugging an issue on OS X that only occurs when the application is
Hey, I got kind of a weird issue here. I have an iPhone-only OpenGL
We have found an issue in our app where Safari on the Mac randomly
There are two instances of Javascript failing through Safari. It's only safari, I've tested
I'm running into an issue with Chrome only (works fine in FF and Safari,

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.