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

Untitled

By: a guest on Aug 11th, 2012  |  syntax: None  |  size: 1.63 KB  |  hits: 8  |  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. test for condition m AND condition n using jquery
  2. // remove the menuA-open class from all class menuA objects except the one being toggled
  3. $(".menuA[name!=" + $(this).text() +"]").removeClass("menuA-open");
  4.        
  5. ($(".menuA[name!=" + $(this).text() +"]") and $("menu[type]==$(this)[type])).removeClass("menuA-open");
  6.        
  7. $(".menuA[name!=" + $(this).text() +"]").removeClass("menuA-open");
  8.        
  9. $(document).ready(function() {
  10.     $(".menuA").click(function(evnt) {
  11.  
  12.         evnt.preventDefault();
  13.  
  14.         $(".menuA").not(this).removeClass("menuA-open");
  15.  
  16.         // hide all other fieldset objects except the one being toggled
  17.         $('fieldset').not($(this).next('fieldset')).hide();
  18.  
  19.         // toggle the fieldset following this link open or closed
  20.         $(this).next('fieldset').toggle();
  21.  
  22.         // toggle the currently selected menuA-open class on or off
  23.         $(this).toggleClass("menuA-open");
  24.     });
  25.  
  26.     $("fieldset").mouseup(function() {
  27.         return false;
  28.     });
  29.     $(document).mouseup(function(evnt) {
  30.         // if user clicked anywhere outside our menus
  31.         if ($(evnt.target).parent("a.menuA").length == 0) {
  32.             // remove the menuA-open class from all class menuA objects
  33.             $(".menuA").removeClass("menuA-open");
  34.             // hide all fieldset objects
  35.             $("fieldset").hide();
  36.         }
  37.     });
  38. });​
  39.        
  40. $(".menuA[name='abc'][type='123']").removeClass("menuA-open");
  41.        
  42. var type = $(this).attr('type');
  43. $(".menuA").not(this).filter("[type='"type"']").removeClass("menuA-open");
  44.        
  45. $(".menuA").not(this).removeClass("menuA-open");
  46.        
  47. $(".menuA[name!='" + $(this).text() +"']").removeClass("menuA-open");