diff --git a/lib/angular-smooth-scroll.js b/lib/angular-smooth-scroll.js index df0c269..baf157b 100644 --- a/lib/angular-smooth-scroll.js +++ b/lib/angular-smooth-scroll.js @@ -87,7 +87,7 @@ do { location += element.offsetTop; element = element.offsetParent; - } while (element); + } while (element && element !== container); } location = Math.max(location - offset, 0); return location;