View Full Version : 'blind.js' toggle only works on homepage page

Robert Mayers
09-26-2011, 10:15 PM
Greetings too all, here is my personal website (http://www.robertmayers.co.uk).


I have a relatively simple few lines of javascript that allow me to slideToggle a div (#main-content-info) into (and back out of) display. The div begins with its display set to none and when the header buttons at the top of the page are clicked, (#main-content-info) slides into display.


The function stops working when you navigate to other pages (http://robertmayers.co.uk/browse-portfolio/bargain/) in the site (by using the "Browse Portfolio" drop down).

How do I allow this function to perform on all pages of the site?

Please see code below.

return false;

Thank you for your time and I would appreciate any responses, long or short – including "don't do it like that, do it like this."


Philip M
09-26-2011, 10:27 PM
Include the code in all the pages of your website where you want it to function. It will not somehow carry forward to another page.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

Robert Mayers
09-26-2011, 11:02 PM
Thank you. I see what you mean.

I actually thought that is what I had achieved. I am using wordpress so the link to the javascript file is within <head>, inside the header.php file. It is just above my other javascript file link for my navigation drop down menu function.

Must I also include link to the code within the page.php file then? I thought it would be called automatically as the first thing that page.php does is 'get_header'.

I hope my poor understanding of javascript does not appear to be antagonising.