You need to pass the function listener to removeEventListener. e.g.
function listener(evn) {
//do stuff like set scrollTop
}
i.e. var scroller = document.querySelector('#scroller');
scroller.addEventListener('content-scroll', listener);
And then you can remove the listener:
*scroller.removeEventListener('content-scroll', listener);*
On Monday, July 27, 2015 at 12:50:34 PM UTC-7, CragVFX wrote:
>
> Hi,
>
> Is there a way to stop listening for the 'content-scroll' event?
>
> i.e. var scroller = document.querySelector('#scroller');
> scroller.addEventListener('content-scroll', function(evn) {
> //do stuff like set scrollTop
>
>
> });
>
> Once I do what I want, how do I stop this from listening to the event?
> I've tried _.removeListener, and I've tried
> removeEventListener('content-scroll', fn) ... can't seem to get it to stop
> emitting content scroll events... any ideas?
>
> Thanks!
>
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/a2aed71c-9057-4a10-b3dd-2d7eeb82976d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.