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

The Archive Base Latest Questions

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

I’m trying to close one div when clicking on another div . Currently, it

  • 0

I’m trying to close one div when clicking on another div . Currently, it opens multiple divs at one time.

JQUERY:

$(document).ready(function() {

    $(".dropdown dt a").click(function() {
        var dropID = $(this).closest("dl").attr("id");
        $("#"+dropID+" dd ul").slideToggle(200);
        return false; 
    });

    $(".dropdown dd ul li a").click(function() {
        var dropID = $(this).closest("dl").attr("id");
        var text = $(this).html();
        var selVal = $(this).find(".dropdown_value").html();
        $("#"+dropID+" dt a").html(text);
        $("#"+dropID+" dd ul").hide();
        return false; 
    });

    $("dl[class!=dropdown]").click(function() {
        $(".dropdown dd ul").hide();
        return false; 
    });


    $("id!=quotetoolContainer").click(function() {
        $(".dropdown dd ul").hide();
        return false; 
    }); 

    $('body').click(function() {
        $(".dropdown dd ul").hide();
        return false; 
    }); 

    $('.productSelection').children().hover(function() {
        $(this).siblings().stop().fadeTo(200,0.5);
    }, function() {
        $(this).siblings().stop().fadeTo(200,1);
    });

});

HTML:

<div id="quotetoolContainer">
  <div class="top"></div>
  <div id="quotetool">
    <h2>Instant Price Calculator</h2>
    <p>Document Type</p>
    <dl id="docType" class="dropdown">
      <dt><a href="#"><span>Select a Document Type</span></a></dt>
      <dd>
        <ul>
          <li><a href="#" id="1">Datasheets<span class="value">Datasheets</span></a></li>
          <li><a href="#">Manuals<span class="value">Manuals</span></a></li>
          <li><a href="#">Brochures<span class="value">Brochures</span></a></li>
          <li><a href="#">Newsletters<span class="value">Newsletters</span></a></li>
          <li><a href="#">Booklets<span class="value">Booklets</span></a></li>
        </ul>
      </dd>
    </dl>
    <p>Flat Size</p>
    <dl id="flatSize" class="dropdown">
      <dt><a href="#">8.5" x 11"<span class="value">8.5" x 11"</span></a></dt>
      <dd>
        <ul>
          <li><a href="#">8.5" x 11"<span class="value">8.5" x 11"</span></a></li>
          <li><a href="#">11" x 17"<span class="value">11" x 17"</span></a></li>
        </ul>
      </dd>
    </dl>
    <p>Full Color or Black &amp; White?</p>
    <dl id="color" class="dropdown">
      <dt><a href="#">Full Color<span class="value">Full Color</span></a></dt>
      <dd>
        <ul>
          <li><a href="#">Full Color<span class="value">Full Color</span></a></li>
          <li><a href="#">Black &amp; White<span class="value">Black &amp; White</span></a></li>
        </ul>
      </dd>
    </dl>
    <p>Paper</p>
    <dl id="paper" class="dropdown">
      <dt><a href="#">Value White Paper (20 lb.)<span class="value">Value White Paper (20 lb.)</span></a></dt>
      <dd>
        <ul>
          <li><a href="#">Value White Paper (20 lb.)<span class="value">Value White Paper (20 lb.)</span></a></li>
          <li><a href="#">Premium White Paper (28 lb.)<span class="value">Premium White Paper (28 lb.)</span></a></li>
          <li><a href="#">Glossy White Text (80 lb.) - Recycled<span class="value">Glossy White Text (80 lb.) - Recycled</span></a></li>
          <li><a href="#">Glossy White Cover (80 lb.) - Recycled<span class="value">Glossy White Cover (80 lb.) - Recycled</span></a></li>
        </ul>
      </dd>
    </dl>
    <p>Folding</p>
    <dl id="folding" class="dropdown">
      <dt><a href="#">Fold in Half<span class="value">Fold in Half</span></a></dt>
      <dd>
        <ul>
          <li><a href="#">Fold in Half<span class="value">Fold in Half</span></a></li>
          <li><a href="#">Tri-Fold<span class="value">Tri-Fold</span></a></li>
          <li><a href="#">Z-Fold<span class="value">Z-Fold</span></a></li>
          <li><a href="#">Double-Parallel Fold<span class="value">Double-Parallel Fold</span></a></li>
        </ul>
      </dd>
    </dl>
    <p>Three-Hole Drill</p>
    <dl id="drill" class="dropdown">
      <dt><a href="#">No<span class="value">No</span></a></dt>
      <dd>
        <ul>
          <li><a href="#">No<span class="value">No</span></a></li>
          <li><a href="#">Yes<span class="value">Yes</span></a></li>
        </ul>
      </dd>
    </dl>
    <p>Qty</p>
    <dl id="quantity" class="dropdown">
      <dt><a href="#">50<span class="value">50</span></a></dt>
      <dd>
        <ul>
          <li><a href="#">50<span class="value">50</span></a></li>
          <li><a href="#">100<span class="value">100</span></a></li>
          <li><a href="#">150<span class="value">150</span></a></li>
          <li><a href="#">200<span class="value">200</span></a></li>
          <li><a href="#">250<span class="value">250</span></a></li>
          <li><a href="#">500<span class="value">500</span></a></li>
          <li><a href="#">750<span class="value">750</span></a></li>
          <li><a href="#">1,000<span class="value">1,000</span></a></li>
          <li><a href="#">1,500<span class="value">1,500</span></a></li>
          <li><a href="#">2,000<span class="value">2,000</span></a></li>
          <li><a href="#">2,500<span class="value">2,500</span></a></li>
          <li><a href="#">3,000<span class="value">3,000</span></a></li>
          <li><a href="#">3,500<span class="value">3,500</span></a></li>
          <li><a href="#">4,000<span class="value">4,000</span></a></li>
          <li><a href="#">4,500<span class="value">4,500</span></a></li>
          <li><a href="#">5,000<span class="value">5,000</span></a></li>
          <li><a href="#">5,500<span class="value">5,500</span></a></li>
          <li><a href="#">6,000<span class="value">6,000</span></a></li>
          <li><a href="#">6,500<span class="value">6,500</span></a></li>
          <li><a href="#">7,000<span class="value">7,000</span></a></li>
          <li><a href="#">7,500<span class="value">7,500</span></a></li>
          <li><a href="#">8,000<span class="value">8,000</span></a></li>
          <li><a href="#">8,500<span class="value">8,500</span></a></li>
          <li><a href="#">9,000<span class="value">9,000</span></a></li>
          <li><a href="#">9,500<span class="value">9,500</span></a></li>
          <li><a href="#">10,000<span class="value">10,000</span></a></li>
          <li><a href="#">12,500<span class="value">12,500</span></a></li>
          <li><a href="#">15,000<span class="value">15,000</span></a></li>
          <li><a href="#">17,500<span class="value">17,500</span></a></li>
          <li><a href="#">20,000<span class="value">20,000</span></a></li>
        </ul>
      </dd>
    </dl>
    <div id="priceTotal">
      <div class="priceText">Your Price:</div>
      <div class="price">$29.00</div>
      <div class="clear"></div>
    </div>
    <div id="buttonQuoteStart"><a href="#" title="Start Printing">Start Printing</a></div>
  </div>
  <div class="bottom"></div>
</div>
  • 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-13T15:43:25+00:00Added an answer on May 13, 2026 at 3:43 pm

    Found my solution!

    $(".dropdown dt a").click(function() {
      var dropID = $(this).closest("dl").attr("id");
    
      if ($("#"+dropID+" dd ul.opened").length) { 
        $('ul.opened').slideToggle(200).removeClass('opened');
      } else {
        $('ul.opened').slideToggle(200).removeClass('opened');
        $("#"+dropID+" dd ul").slideToggle(200).addClass('opened');
      }
      return false;     
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 290k
  • Answers 290k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Typically for this sort of thing you would use a… May 13, 2026 at 5:52 pm
  • Editorial Team
    Editorial Team added an answer hgwebdir.cgi doesn't really authentication, although it can do authorization. You… May 13, 2026 at 5:52 pm
  • Editorial Team
    Editorial Team added an answer Use DOMDocument to parse the document and then use its… May 13, 2026 at 5:52 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
In order to apply a triggered animation to all ToolTip s in my app,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.