How can you save / cache bool variable for the duration of the session with the ability to reload the page, but when you close the tab to reset, something like this
localStorage.setItem('rebuild', 'true'); var bool = localStorage.getItem('rebuild'); window.onscroll = function(){ var scrollT = window.pageYOffset; if(scroll > 300 && bool === true){ init("canvas"); bool = false; } } and then replace the above for the session?
sessionStoragedisappears after a reboot, but I need it so that it is reset to zero after the page closes, I thought through cookies, but somehow it’s probably not right - Lieutenant Jim Dangle