I have an image that, when clicked, goes full screen and pressing the browser back button minimizes it
OR any other <button> connected to the fullscreen() also minimizes it
so far I've come up with this:
function fullscreen(show){
if(show){
... # maximize image
history.pushState({id:1},null)
}
else{
... # minimize image
history.go(0)
}
window.addEventListener("popstate",()=>{
fullscreen(false)
});
fiddle (but you'll have to run it locally on an .html file)
but the problem is that this approach reloads the entire page so is there a way to keep the page from reloading?
