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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:58:07+00:00 2026-05-19T11:58:07+00:00

I got a coldfusion query where the result is grouped on country names. With

  • 0

I got a coldfusion query where the result is grouped on country names. With a click on this one, I try to open or close the list under the country. But i cannot work correctly with this siblings and this parents. The result is, if i click on a country name, the fourth one, for example, it close all childrens, and the three country name which are before too.
Can someone help me to choose the right selectors ?
Thank you in advance ,
Michel

The code:

<script type="text/javascript" language="javascript">  
    $(document).ready(function(){
        var toggleMinus = '<cfoutput>#variables.strWebAddress#</cfoutput>/images/bullet_toggle_minus.png';
        var togglePlus = '<cfoutput>#variables.strWebAddress#</cfoutput>/images/bullet_toggle_plus.png';
        var $subHead = $('table#categorylist tbody th:first-child');
        $subHead.prepend('<img src="' +toggleMinus+ '" alt="collapse this section" />&nbsp;');
        $('img', $subHead).addClass('clickable').click(function(){
            var toggleSrc = $(this).attr('src');
            if(toggleSrc == toggleMinus){
               $(this).attr('src',togglePlus).parents('.country').siblings().fadeOut('fast');
            }else{
              $(this).attr('src',toggleMinus).parents('.country').siblings().fadeIn('fast');
            }
        });
     }); 
</script>

<table width="95%" border="0" cellspacing="2" cellpadding="2" align="center id="categorylist"> 
<thead>
    <tr>
        <th class="text3" width="15%">
            <cfmodule template="../custom_tags/get_message.cfm" keyName="L_ACTOR_CODENUMBER">
        </th>
        <th class="text3" width="15%">
            <cfmodule template="../custom_tags/get_message.cfm" keyName="L_ACTOR_CODE">
        </th>
        <th class="text3" width="55%">
            <cfmodule template="../custom_tags/get_message.cfm" keyName="L_ACTOR_NAME">
        </th>
        <th class="text3" width="15%">
            <cfmodule template="../custom_tags/get_message.cfm" keyName="L_ACTIVE">
        </th>
    </tr>
</thead>
<tbody id="content">
<cfoutput query="qryCategoryUrl" group="country_name" groupcasesensitive="false">
    <tr class="country">
        <th style="font-weight:bold; text-align:left;" colspan="4">#country_name#</th>
    </tr>
<cfoutput>
    <tr>
        <td valign="top" class="text3">#Replace(ACTOR_CODENUMBER, Chr(13) & Chr(10), "<br>", "ALL")#&nbsp;</td>
        <td valign="top" class="text3">#Replace(ACTOR_CODE, Chr(13) & Chr(10), "<br>", "ALL")#&nbsp;</td>
        <td valign="top" class="text3">#Replace(ACTOR_NAME, Chr(13) & Chr(10), "<br>", "ALL")#&nbsp;</td>
        <td valign="top" class="text3"><cfmodule template="../custom_tags//get_message.cfm" keyName="#ACTIVE_display(qryCategoryUrl.ACTIVE)#"></td>
    </tr>
</cfoutput>
</cfoutput>
</tbody>
</table>
  • 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-19T11:58:07+00:00Added an answer on May 19, 2026 at 11:58 am

    Instead of:

    .parents('.country').siblings().fadeOut('fast');
    

    Try this:

    .closest('.country').nextUntil('.country').fadeOut('fast');
    

    And of course, apply the same change to the .fadeIn(). You might also look into .fadeToggle()docs.

    Here’s a (reduced) example: http://jsfiddle.net/redler/5sqJz/. While it doesn’t affect the example, presumably you would be setting the initial state of those detail rows as hidden.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Python list confusion I've got one little question about Python lists: Why
I have got this query which works fine: SELECT p.design_id, p.product_id, t.account_id, p.name, p.width,
I've got a Coldfusion component, with a method in it called getColumnNames This just
I've got a strange issue with some Coldfusion/SQL Query output. The actual data is
Got a programm with 2 threads. one thread is writing some stuff into the
Got this error message while trying to load view: The model item passed into
Got a question for some jQuery wizard who might stumble upon this. When I
got a problem, can't get my head around this jquery and would appreciate your
Got a question regarding SQL and ColdFusion: I can't write SQL code properly, so
I've basically got 2 events. The top one selects the selection from a jQuery

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.