Return to Snippet

Revision: 38948
at January 11, 2011 00:05 by eckbert


Initial Code
    function containsPoint(elem, x, y){
      var top = elem.offset()['top'];
      var bottom = (elem.offset()['top'] + elem.outerHeight());
      var left = elem.offset()['left'];
      var right = (elem.offset()['left'] + elem.outerWidth());
      if((x > left) && (x < right) && (y > top) && (y < bottom)) return true;
      else return false;
    }

    function closeMenu(e){
      var box = $('.dropdown-rplcmnt');
      var box2 = $('.over-menu');
      var px = e.pageX;
      var py = e.pageY;
      if(containsPoint(box,px,py) || containsPoint(box2,px,py));
      else {
        box2.stop().fadeOut(400);
      }
    }

Initial URL

                                

Initial Description

                                

Initial Title
dropdown replacement close

Initial Tags
textmate, jquery

Initial Language
jQuery