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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:56:32+00:00 2026-05-17T21:56:32+00:00

I have a panel hide/show setup that is triggered from a list item anchor.

  • 0

I have a panel hide/show setup that is triggered from a list item anchor. Works great. The problem is, I also have a dropdown menu in the site navigation that also needs to trigger each panel, from any page on the site. Like say, I have panels (in this order), “Hardware”, “Software”, “Accessories” on the Products page. So when I’m on the About page, and I click “Software”, the expected result is to take me to the Products page and have the “Software” panel open. Here’s my jquery script for the panel:

$("ul#product-type li a").click(function() {
$("ul#product-type li").removeClass("selected");
$(this).parent().addClass("selected");
var currentTab = $(this).attr("href");
    $("div.panel").hide();
    $(currentTab).show();
return false; });

Dropdown Nav Markup:

<ul id="nav">
<li><a href="/products/#hardware"><span>Hardware</span></a></li>
<li><a href="/products/#software"><span>Software</span></a></li>
<li><a href="/products/#accessories"><span>accessories</span></a></li>

I’ve tried adding the nav selector to the click function, but that doesn’t work. Any ideas or suggestions would be hugely appreciated.

Cheers,
Ryan

  • 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-17T21:56:33+00:00Added an answer on May 17, 2026 at 9:56 pm

    The href isn’t a valid selector, since $("/products/#hardware") wouldn’t work. However using the .hash property is perfect, as you’ll get $("#hardware"). Use it like this:

    $("ul#product-type li a").click(function() {
      $("ul#product-type li").removeClass("selected");
      $(this).parent().addClass("selected");
      $("div.panel").hide();
      $(this.hash).show();
      return false; 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a setup like this. var element = $(.module-panel, this.el); $('.module-panel:not('+element+')').hide(); What I'm
I have this very basic tabbed block: $('.tabbed-section .panel').hide(); $('.tabbed-section .panel:first').show(); $('.tabbed-section .tabs li:first').addClass('active');
I have this jQuery: $(document).ready(function() { $(#panel).hide(); $('.login').toggle( function() { $('#panel').animate({ height: 150, padding:20px
I have panel that is using group layout to organize some label. I want
I have a Panel that I'm using to display information about a location. I
I have an Panel control that I need to maintain position across postbacks. I
I have a panel that draws alot of things. To make drawing effecient I
I want my panel to fit the frame when I show/hide fields. How could
I am pretty new to ASP.NET. I need to create a show/hide panel in
I have a spark TabBar and I want to hide and show some elements

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.