【发布时间】:2016-11-03 08:01:13
【问题描述】:
我有一个基于关键字修改 DOM 的 chrome 扩展。问题是,对于像 twitter 这样无限滚动的网站,我需要一种方法让我的函数在用户滚动页面时保持触发。
.livequery() 是唯一的方法还是有更好的方法?
现在所有的逻辑都是纯 JavaScript/Jquery,但如果这是最好的方法,我愿意使用像 Angular 这样的框架。
I have several functions that interact -
1) a hide() function that adds a class to divs containing words I want hidden
2) a walk() function that walks the DOM and identifies divs to call hide() on
3) walkWithFilter() function that gets words to filter from localstorage and calls walk() function
最后一个函数walkWithFilter()在window.onload()事件中被调用
【问题讨论】:
标签: javascript jquery angularjs dom infinite-scroll