Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Mar 28th, 2012  |  syntax: jQuery  |  size: 0.71 KB  |  hits: 39  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $(document).ready(function(){
  2.         var active = "";
  3.         $(".dropdown").click(function(){
  4.                 var id = $(this).attr("id");
  5.                
  6.                 if (active != "")
  7.                 {
  8.                         if (active == id)
  9.                         {
  10.                                 $("#" + active + "-dropdown-contents").slideUp("slow", function(){});
  11.                                 id = "";
  12.                         }
  13.                         else
  14.                         {
  15.                                 $("#" + active + "-dropdown-contents").slideUp("slow", function(){
  16.                                         $("#" + id + "-dropdown-contents").slideDown("slow", function(){});
  17.                                 });
  18.                         }
  19.                 }
  20.                 else
  21.                 {
  22.                         $("#" + id + "-dropdown-contents").slideDown("slow", function(){});
  23.                 }
  24.                 active = id;
  25.         });
  26.         $(".header-bottom-contents-close").click(function(){
  27.                 var id = $(this).attr("id");
  28.                 $("#" + id + "-dropdown-contents").slideUp("slow", function(){});
  29.         });
  30. });