javascript - Why is my scroll eventListener not firing? -
i'm working on building infinite scroll feature in angular app. building 1 step @ time, i'm @ part attach eventlistener #tags-panel-list , need check it's y position.
however eventlistener i'm using not firing basic console.logs.
plnkr: http://plnkr.co/edit/7onkagvvnxwlwn5fzqju?p=preview
tagspanel.html markup:
<section id="tags-col" class="tag-column column"> <ul id="tags-panel-list"> <li ng-repeat="tag in tags"> <div class="tag">{{tag.term}}</div> </li> </ul> </section> tagspaneldirective controller code (used $timeout incase angular not see dom element on first load):
var scrollingelement = function(event) { // not see these console logs in chrome dev inspector console.log('scrolling...'); console.log(event); }; $timeout(function() { document.getelementbyid('tags-panel-list').addeventlistener('scroll', scrollingelement); }, 250);
it's element id tags-col scrolling:
$timeout(function() { document.getelementbyid('tags-col').addeventlistener('scroll', scrollingelement); }, 250);
Comments
Post a Comment