diff --git a/angular-scroll-dropdown.js b/angular-scroll-dropdown.js index c9948c6..f980fa5 100644 --- a/angular-scroll-dropdown.js +++ b/angular-scroll-dropdown.js @@ -18,9 +18,9 @@ // change dropdown position if click on button button.bind('click', function() { - var dropdown = elm.find('body .dropdown-menu-scoll:visible'); - var dropDownTopInBottom = button.offset().top + button.outerHeight() - $window.pageYOffset; - var dropDownTopInTop = button.offset().top - $window.pageYOffset; + var dropdown = angular.element($.find('body .dropdown-menu-scoll:visible')); + var dropDownTopInBottom = button.offset().top + button.outerHeight() - $window.pageYOffset; + var dropDownTopInTop = button.offset().top - $window.pageYOffset; if (dropdown.height() > dropDownTopInTop) { dropdown.css('top', Math.floor(dropdown.height() - dropDownTopInTop - button.outerHeight(true)) + "px");