A
A
ayapergenov2015-10-19 11:39:12
css
ayapergenov, 2015-10-19 11:39:12

How to hide the block after a click with a page reload?

For the adaptive page, I made it so that the block can be displayed and hidden when the button is clicked.
The block contains links to product categories.
After clicking on the link, the block is hidden using the jQuery script, but after reloading the page with the selected product category, the block appears again.
How to make it not appear after page reload? And when necessary, the user will turn it on with a button.
What are the options?
While thinking about using cookies. Maybe there is some other option?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Surzhikov, 2015-10-19
@Surzhikov

When reloading the page - use #
Something like this: site.ru/page.php#hideblock
Then check it with JS (this is called location.hash)
www.w3schools.com/jsref/prop_loc_hash.asp

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question