On my web page NicoComerc when u open it, there is custom div at bottom left position to show “traditional pasta” – girl on every page that u open.
But i want to hide that div when u open this URL from the left menu. (that url is > ÐÑоизводи > ÐоÑпалÑваÑи) <- sry its macedonian language…
So is it possible to do it, and if so… how to make that?
Thanks!
Yes it’s possible. You can do that by checking if the url fits some pattern. In javascript, one way to achieve that is the following one …
Code
You are calling the script too soon in your page. When
$('#devojka')
is executed, the element (devojka) is not in page yet.Move you script to the bottom of the page or wrap your code to the
window.onload
.More about window.location: https://developer.mozilla.org/en-US/docs/Web/API/Window.location
Required JQuery, but you already have it
I would add a query string to the link in the menu (
/menu/item?hide_div=1
). Then you can check for the existence of string on the server side or with javascript.You can just write JavaScript/JQuery such as the following