1
On a supposed page where all the content all the site is loaded in dynamic Ivs without the refresh need, when closing one of these Ivs it is possible to reset the Function that added the content to that div along with all the other / functions events within it? Or more correct would be I create conditions to know if the element is visible or not and then proceed with the rest of the functions?
What do you call reset?
– Maniero
In a div for example that will be loaded video, will be doing ajax requests sending the watched video time, some keys that have their default functions modified within the function, space, enter... after closing I would like all these events created by this Function to be reset and only work again when Function is called again
– Leo Letto
You need to undo everything manually, including removing or emptying such div.
– bfavaretto
and put conditions on all created events that will repeat every x seconds while that div is visible?
– Leo Letto
Or remove events https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener
– bfavaretto
removeEventListener will remove everything created by Function and reset variables or only events?
– Leo Letto
removeEventListener
needs to be used in a very specific way. You better [Edit] your question and include the relevant code (js and the relevant HTML)– bfavaretto
It reminded me of a similar question I asked over a year ago. You may be of some use in your case: http://answall.com/questions/81795/activar-e-deactivar-um-evento-sem-precis-excluir-e-recriar-o-mesmo
– Daniel Omine
Some solutions presented in your question suit me well @Danielomine but as you said in your question "I expected something more elegant from jQuery"
– Leo Letto