JavaScript js/jQuery: Stop event listener

I have multiple DOM elememts. When each one becomes visible within the window then I fire an animation on that element.

Each element registers the window scroll event to the same event handler, passing this handler the element's ID and an event-specific callback function for the animation.

This single event handler tests if the element is on screen and if so fires the callback.

But ... it still listens for the window scroll event even after firing the callback. How can I turn off the scroll listener? jQuery "off" didn't work.

$(window).on('scroll', function () {
    sharedFunctionsModuleName.initialAnimationWhenChartBottomVisible({
        chartID: chartID,
        callbackFunction: thisWebpageModuleName.animationFunctionName
    });
});
Answer:1

EventTarget.removeEventListener()?

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener

Answer:2

This is the JSON i have { "version": "5.2", "user_type": "online", "user": [ { "name": "John", "id": 50 }, { "name": "Mark", ...

This is the JSON i have { "version": "5.2", "user_type": "online", "user": [ { "name": "John", "id": 50 }, { "name": "Mark", ...

  1. json html table example
  2. json html table
  3. json html table javascript
  4. json html table using jquery
  5. json html table with filter
  6. json html table jquery
  7. json html table online
  8. json to html table python
  9. json to html table php
  10. json to html table c#
  11. json to html table java
  12. json into html table
  13. json to html table converter
  14. json to html table node js
  15. json to html table js
  16. json data html table
  17. json 2 html table
  18. json to html table library
  19. json to html table code
  20. json to html table node

I've been working in a legacy code that have a certain functionality that should return a random item for array and I see the following expression: array[Math.random() * arr.length | 0] My first ...

I've been working in a legacy code that have a certain functionality that should return a random item for array and I see the following expression: array[Math.random() * arr.length | 0] My first ...

HTML5 Workers can close themselves by calling the close() method. Is there a way to tell if the worker process is alive/running or if it has been closed? var myWorker = new Worker("worker.js"); ... ...

HTML5 Workers can close themselves by calling the close() method. Is there a way to tell if the worker process is alive/running or if it has been closed? var myWorker = new Worker("worker.js"); ... ...

i am working on developing on an Html page where i have two div. In each div i have one image. I want that each image should be visible for 2 second and after that the second div should get visible. ...

i am working on developing on an Html page where i have two div. In each div i have one image. I want that each image should be visible for 2 second and after that the second div should get visible. ...

  1. powerpoint slide show repeated