What needs to be added so that the function starts working after a certain scroll and works only once?

  • 0
    Good afternoon!
    There is the following function.
    Its essence is as follows: when you move the mouse cursor off the screen, a modal window appears.
    Can you please tell me what needs to be added and how to make this function work after a certain scroll, for example, at 900px and, most importantly, so that it works only once?
    I would be very grateful to you!

    $(function() {
          var $window = $(window);  
          $window.on('mouseout', function(e){
              if (e.toElement === null) {
            $('.decline').on('click', function() {
            }) ;
    CSS Adrian Payne, Jul 10, 2020

  • 0 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!