]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fixed positionning with scrollable offsetParent 2026/head
authorKorri <korrigan33@gmail.com>
Mon, 25 Mar 2013 18:00:47 +0000 (14:00 -0400)
committerKorri <korrigan33@gmail.com>
Mon, 25 Mar 2013 18:00:47 +0000 (14:00 -0400)
js/foundation/foundation.dropdown.js

index 474993a637d28d99b0689c96ab77bcd2e5ab69a1..e5e04a3e5ad36522faad6e1856dca59ff916e636 100644 (file)
     },
 
     css : function (dropdown, target) {
-      if (dropdown.parent()[0] === $('body')[0]) {
-        var position = target.offset();
-      } else {
-        var position = target.position();
-      }
+      var position = target.position();
+      position.top += target.offsetParent().scrollTop();
+      position.left += target.offsetParent().scrollLeft();
 
       if (this.small()) {
         dropdown.css({