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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:02:04+00:00 2026-05-11T21:02:04+00:00

I have a ticket management program that I am trying to add ‘accordian’ style

  • 0

I have a ticket management program that I am trying to add ‘accordian’ style functionality to using jQuery. This program is written in PHP. The output HTML looks like this:

<div class="eachticketwrapper">
     <div class="simpleticketview">
           <ul class="displayinline ticketsummarybar">
                    <li class="col0"><a href="#" class="toggleLink">E</a></li>
                       //...
           </ul>
      </div> <!-- simpleticketview -->
<br class="clear" />
<div class="toggle"> <!-- hiddenticketview -->
     //...
</div>

This repeats dozens of time on a page.

My jQuery code looks like this:

$(document).ready(function() {
   $('div.toggle').hide();
   $('.toggleLink').click(function() {
        $(this).next('div.toggle').slideToggle('fast');
   return false;
   });
});

When I click on the E it will not slide the next div. in fact nothing happens.

I have tried to use :
$(‘div.toggle’).slideToggle(‘slow’);

And this causes all divs to toggle. But i need it to target the NEXT div.

Thanks in advance.

  • 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-11T21:02:05+00:00Added an answer on May 11, 2026 at 9:02 pm

    you need to give your ‘toggle’ div a unique id and match it w/your link id. then target those ids:

    <div class="eachticketwrapper">     
        <div class="simpleticketview">           
            <ul class="displayinline ticketsummarybar">
                    <li class="col0"><a href="#" id="link-1234" class="toggleLink">E</a></li>
                       //...           </ul>
      </div> <!-- simpleticketview -->
      <br class="clear" />
      <div id="ticket-1234" class="toggle"> <!-- hiddenticketview -->     
       //...
      </div>
    

    jQuery:

    $(document).ready(function() { 
        $('div.toggle').hide(); 
        $('.toggleLink').click(function() { 
            var id = $(this).attr("id").split("-");
            $("#ticket-" + id[1]).slideToggle('fast'); 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 Ticket class that contains a List of User objects: class Ticket
I have a ticket model which has a method inside called closes_in that calculates
I'm programming a Ticket Management system with CodeIgniter and I have an MVC dilemma
Here is my problem. I have a ticket-tracking system that is not very 'user
EDIT: I have created a ticket for this which has data on an alternative
I have a table named ticket. I am trying to query between two dates,
I have this function in module MessagesHelper : def message_block( message, ticket, comment )
I have some ticket numbers that may have numbers and letters mixed. I'll be
I'm trying to add a ticketing system to a custom back-end that powers the
We have a ticket system that sends us tickets with the title "New Ticket

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.