1

I am working on a site located here: http://temminktrainingcoaching.nl/beta/

There's a lavalamp menu, and when you click on the links it loads the pages by including php files in index.php (which is all content except for the logo and menu)

Structure is more or less as follows:

<!-- index.php --> 
<div id="logo + menu"></div>
<div id="some content"></div>

<div id="include">
<!-- seperate php files are include here -->
</div>

Problem: When clicking on a link in the menu and loading a new php page, the lavalamp slider jumps back to it's original position, but it should stay at the clicked link.

I'm new to jquery, so it's just a try: but i thought the easiest way to fix this was to add a piece of javascript to each seperate php file which sets the lavalamp slider to the right link.

More info: I'm using this lavalamp: http://www.gmarwaha.com/blog/2007/08/23/lavalamp-for-jquery-lovers/

kapoko
  • 938
  • 1
  • 11
  • 29

1 Answers1

0

As I see, you can set this menu x position in php GET parameter, because it sets to zero position just when your page is being updated.

UPDATE: But anyway, you should edit your lavalamp plugin a little to set directly the position through your own function. Script is quite short to edit it.

ISE
  • 436
  • 2
  • 9
  • 21
  • Sounds fair, but could you give an example of the script? I am new to jquery, let alone javascript. Thanks :) @ISE – kapoko Sep 15 '11 at 21:59
  • Hmm, my first solution seems stupid for me now, because user will see updating page. there are simpler solution: ` $.get('your_url', function(url_content) { $('#your_div').html(url_content) } ); ` For registering user clicks you may use jquery.bind or just HTML "A" with "href=javascript", calling your function with your url. So, just read http://api.jquery.com/get/ to understand it better. – ISE Sep 16 '11 at 02:26
  • Sorry, but it's still not clear to me. Could you keep in mind that i'm not at all comfortable in javascript yet ;)! Where do I put this function you're showing? I read the link you gave, but I don't understand yet how I can change the x value of the menu by the get function. Here's the source of the lavalamp: http://temminktrainingcoaching.nl/beta/js/jquery.lavalamp.js , feel free to check it out, maybe it helps with giving a more clear example, which is what i need ;). Thank you for your time! @ISE – kapoko Sep 17 '11 at 19:15