Hello
I'm working on a website for a friend. The website can be found here:
http://sidway.zonlicht.eu/ . Please take a closer look at the menu. When you hover your mouse over the options, a bar will float to that option. This bar will return to the 'contact' option in the menu when you stop hovering.
The problem here is as follows: The bar should return to the menu option which is linked to the page you are currently looking at. I.E.: When you click 'Media', you go to the corresponding page. And now the moving bar under the menu should go to 'Media' in the menu instead of 'Contact'. But it doesn't!
This is because the Javascript controlling the bar (which is called LavaLamp), cannot link the current page to a menu option. The script then falls back to the first menu option it finds, which is 'Contact'.
The reason is that i set up the site, aswell as the server to use ‘friendly’ urls, which means that for example:
http://sidway.zonlicht.eu/en/media is changed on the serverside to
http://sidway.zonlicht.eu/en/index.php?p=media . This means that when you go to the first url, the server (as well and the php code in the php file) will think you opened the second url.
So i changed the menu href=”” options from “index.php?p=EXAMPLE” to “../EXAMPLE”. This way you end up on the same page, but with a user friendly url. The problem is that the Javascript controlling the bar, can now no longer link a page (which is now “/en/media”) to the menu item, which hrefs to “../media”. This is the reason it falls back to Contact, which is the first menu option you’ll find in the html code.
Can you help me alter the JavaScript code, so that the bar in the menu works, even with the userfriendly URL’s?
This is the Javascript
:
http://sidway.zonlicht.eu/scripts/lavalamp.js
The part of the code where the problem lies is between lines 288 and 309 <<--- I THINK !!.
The php file which uses the javascript is here:
http://sidway.zonlicht.eu/en/index.php , the way to open this file in your browser is:
http://sidway.zonlicht.eu/en/home .
Can you please help my to solve this problem? It has been bothering me for days and I simple can;t figure out a solution by myself. PLEASE help!
Kind Regards,
Richard Homan