I want an event to be triggered after the user scrolls, say 300px after another event happens.
To put simply, an example would be:
I want the user to first press a button and then after pressing the button when he scrolls by some amount, an event is triggered, also if the user didn't press the button then the event does not trigger. The button may be anywhere in the viewport for eg: and the scroll amount should be considered relative to from when the button was pressed not from the start of the page.
Note: this was just an example to explain what I want to do, this is not exactly what I'm trying to do but a general logic would help, thanks.