W
W
westdp2015-09-20 16:33:51
JavaScript
westdp, 2015-09-20 16:33:51

How to make a block visible if there is # in the url?

Hello, there is such a question, for example, there are a couple of vacancies on the career page, they open when you click on a certain menu on the left of the page.
Working site
How can I make sure that when changing the url, for example , outsoft.com/careers#Business-Development-Manager , a specific job block appears?

Well, and accordingly, when you directly went to this URL ( outsoft.com/careers#Business-Development-Manager ), was there an open required vacancy for Business Development Manager?
Thanks for any help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Inchin ☢, 2015-09-20
@westdp

On the loading page, catch location.hash.

$(function(){
   //Адрес: http://site.ru#hash228
   $(location.hash).show(); //Показать блок с id = "hash228"
   //Или проверять что в хэше
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question