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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:43:40+00:00 2026-05-13T07:43:40+00:00

great community :) I have category list which have nested child category list, which

  • 0

great community 🙂

I have category list which have nested child category list, which is hidden.
My problem is that parent categories have link to page, and I want to add “+” sign next to them so if You click on “+” child list will be expanded, “+” will be replaced with “-” (for closing), and if You click on category name, You will be taken to that page.
So i need chaning + and – along with cclick option, if you could understood me, my english sucks 🙂

Here is the code that I’m trying to create:

$(document).ready(function() {
 $("ul#sitemap li ul").hide();
 $('ul#sitemap li:has(> ul)').prepend(' <a href="javascript:;" class="open">+</a>');
 $('ul#sitemap li a.open').click(function () {
   $(this).html('-').removeClass('open').addClass('clicked'); 
   $("ul li>ul:visible").hide("slow");
   $(this).parent('li').find('ul').slideDown();
 });

 $('sitemap li a.clicked').click(function () {
   $(this).html('+').removeClass('clicked').addClass('open'); 
   $(this).parent('li').find('ul').slideUp();
 });
});
  • 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-13T07:43:40+00:00Added an answer on May 13, 2026 at 7:43 am

    Use

    live for the newly created anchor tags and this should work

    $('ul#sitemap li a.open').live ( "click" , function () {
    

    and

    $('sitemap li a.clicked').live ( "click" , function () {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello Great community of SO! I have created a GUI application with qt and
I'm currently working on an objective c project, and have a method that enables/disables
I have been using Apache POI for quite sometime and it works great but
First of all, I wanted to thank the community. You've been of great support
Despite that I’m a regular reader of this great forum, this is my first
I'm looking for some advice from the community about constructing an online store based
I've been working on the next step of my continuous integration project, which is
In advance, I would like to say thanks for the help. This is a
I've posted a few questions prior to this one regarding the use of std::function
I've been working on this for a long time, and I feel very worn

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.