Id say one possible solution is to add its state of open/closed to a cookies variable, this way, when a new page is opened/closed, the value gets saved.
First get this: https://github.com/carhartl/jquery-cookie
and include in your files, then, for example on how to use,
go here: How do I set/unset cookie with jQuery?
Then once you understand all that, then to give you a quick n dirty example, you
(Pseudo code)(jQuery)
$(document).ready(function(){
//set cookie here
$.cookie("IsBoxOpen", "yes"); //meaning yes its open on default
$('#buttonToCLickHere').on("click", function(){
if(box is open){
//then close it with css/js etc but then save its state
//code to close it visually here, then
$.cookie("IsBoxOpen", "no"); //meaning now itll be closed
} else {
//do the opposite here, and then also save its status with the cookie.
}
});
});
Like this, everytime someone opens/closes the box (or clicks the button) its state gets saved in cookies and the user wont know the diff going from page to page.
OH and PS, this code has to go in a footer.php or header.php file (or html) so that the check happens on every page.
Hope this helps and steers you in the right direction