How to continue the jquery function on another page

On a button click run the function

for example $(‘.div1’).show();

from a page

and the above function needs to run along with another functions on other few pages until click a second button on any of those pages.

Any or All help welcome.