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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:59:14+00:00 2026-05-26T10:59:14+00:00

My website(php) has some categories and corresponding sub categories. I want to display them

  • 0

My website(php) has some categories and corresponding sub categories.

I want to display them in tree structure.

First of all the categories should be displayed with a plus sign , when someone clicks the plus sign , below categories should slide down and corresponding sub categories should display.

This is very common thin i found on many web sites but unable to find how to do it.

pls suggest how to implement this structure.

Thanks.

  • 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-26T10:59:14+00:00Added an answer on May 26, 2026 at 10:59 am

    Use jQuery, my demo
    js (this is a plugin wrote in 3 minutes):

        (function($){  
     $.fn.subcath = function() {  
       return this.each(function() {  
       obj = $(this);     
       var subcath=$('.subcath', obj);
       alert(obj.html());
       obj.click(function (){
            subcath.toggle('slow');
        });
       });
        }})(jQuery);  
    

    HTML:

         <SCRIPT language="JavaScript" SRC="jquery.js"></SCRIPT> 
         <SCRIPT language="JavaScript" SRC="my_plugin.js"></SCRIPT> 
       <script>
             $().ready(function() {  
                $('.subcath').hide();
                    $('.menu').subcath();
              });
        </script>  
    
        <ul class='menu'> 
         <div class="cathegory" >
                <li class="cath" >Cath1</li>
            <div class="sub_cathegory" >
                <ul class="subcath"> 
                     <li class="sub_el" >Cath1</li>
                     <li class="sub_el" >Cath2</li>
                </ul> 
            </div>
         </div>
             <div class="cathegory" >
                <li class="cath" >Cath1</li>
            <div class="sub_cathegory" >
                <ul class="subcath"> 
                          <li class="subcath_el" >Cath3</li>
                      <li class="subcath_el" >Cath4</li>
                </ul>
            </div>
         </div>
        </ul>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a PHP-Mysql based website which has some large lists to
Some years ago I created a small website in PHP that now has grown
This should a quick question for some easy rep. I'm doing some PHP Website
I have working website in PHP with a MySQL backend which has several tables
I'm trying to add some twitter funcionality to my website (php). I publish links
I want to allow registered users of a website ( PHP ) to upload
I have an php website with login form and I want every visitors can
I have a a php website with some code on it to pull from
I am programming my first real PHP website and am wondering how to make
I have a website which has some non standard characters such as ë ,

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.