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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:53:35+00:00 2026-06-14T11:53:35+00:00

I have 2 html page in Page 1 there is 2 links link1 &

  • 0

I have 2 html page

in Page 1 there is 2 links “link1” & “link2”

in Page 2 there is also 2 links “link1” & “link2” as well as 2 <div id="pan1"> & <div id="pan2"> <div id="pan1">

& <div id="pan2"> is working as show/hide with jquery

I want when user click on the link1 in page1 it will go to page 2 and div”id=pan1″ will show and when user click on the link2 in page1 it will go to page 2 and div”id=pan2″ will show.

here is the html code for page 1

<ul class="linkList">
<li><a href="#pan1">Link 1</a></li>
<li><a href="#pan2">Link 2</a></li>
</ul>

here is the code for page 2

html

<ul class="linkList">
<li><a href="#pan1">Link 1</a></li>
<li><a href="#pan2">2</a></li>
</ul>
<div id="pan1" class="switchgroup" style="padding:10px; background-color:#060">div 1</div>
<div id="pan2" class="switchgroup" style="padding:10px; background-color:#936">div 2</div>

css

#pan1, #pan2{
    display:none;   
}

jquery

$(document).ready(function(){
    $('#pan1').show();
    $('.linkList li:first-child a').addClass('active');
    $('.linkList li a').click(function() {
        var tabDivId = this.hash;                              

        $('.linkList li a').removeClass('active');
        $(this).addClass('active');
        //console.log(tabDivId);
        $('.switchgroup').hide();
        $(tabDivId).fadeIn();
        return false;
    });
});
  • 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-14T11:53:36+00:00Added an answer on June 14, 2026 at 11:53 am

    This should give you a general idea of how to do it. Please note I haven’t tested this code so it might have some minor issues.

    Page 1 HTML:

    <ul class="linkList">
        <li><a href="page2.html#pan1">Link 1</a></li>
        <li><a href="page2.html#pan2">Link 2</a></li>
    </ul>
    

    Page 2 HTML:

    <ul class="linkList">
        <li><a href="#pan1" class="panlink">Link 1</a></li>
        <li><a href="#pan2" class="panlink">2</a></li>
    </ul>
    <div id="pan1" class="switchgroup">div 1</div>
    <div id="pan2" class="switchgroup">div 2</div>
    

    Page 2 JS:

    $(function() {
        var anc = window.location.href.split('#')[1];
        $('#' + anc + '.switchgroup').show();
    
        $('a.panlink').click(function() {
            $('.switchgroup').hide();
            $($(this).attr('href')).show();
        });
    });
    

    Page 2 CSS:

    .switchgroup { display: none; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that loads an external HTML page into an iFrame. There
In my html page, I have one table, for every row there are two
I have 2 files, main.html and search.php . Within the main.html page, there is
I want to show three XMLs on a single html page. These XMLs have
I have HTML page where windows media player is embedded. It works very well
I am working on an iPhone Web App using HTML & CSS. I have
I have the following page I'm working on: http://69.134.44.19:8000/products.html?v=products In Google Chrome and Firefox,
I have a HTML code like this: <div class=links nopreview><span><a class=csiAction href=/WebAccess/home.html#URL=centric://REFLECTION/INSTANCE/_CS_Data/null>Home</a></span>&nbsp;•&nbsp;<span><span><a class=csiAction href=/WebAccess/home.html#URL=centric://SITEADMIN/_CS_Site>Setup</a></span>&nbsp;•&nbsp;</span><span><a
Suppose I have an HTML page with three blocks of fixed width (their height
A very simple question. I have a html page which is divided into three

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.