setTimeout() and setInterval() behave oddly in GeogebraBooks
New
I have created a number of apps using setInterval() and/or setTimeout() functions. They work as they should when I open the apps directly in web (e.g. https://ggbm.at/Fgcr47Df). However, when I use them in a GeogebraBook (e.g. https://www.geogebra.org/m/...), the timers seem to be vastly incorrect. More precisely, the pseudo-tooltip I've created disappears much faster than intended (3 seconds). Sometimes, the bug doesn't immediatly occur but I can always reproduce it by switching apps using the navigation on the LHS. Is this a known bug? Is there a workaround I could use in the meantime?
I think the problem is that the interval keeps running after you switch between pages of the book. Please consider something like
clearInterval(window.tooltipBijeciveTimer);
tooltipBijeciveTimer=setInterval(function(){ ...}, 1000);
Even better is to get rid of JS completely; create a hidden animated slider and append a GeoGebra script to update event of that slider.
Comments have been locked on this page!