tags:

views:

29

answers:

3

Hello, I have a background image scroll on a DOM element. This works great, but when the user clicks a link to load a new page, the background image scrolling starts back at its original position...

Any clever way of making this appear more continuous so it's not jumpy? I thought about a cookie, but was concerned that would be writing much to frequently and could crash the browser is it's animating constantly.

Thanks

A: 

How about only write the cookie when a link is pressed?

Corey
A: 

You could only update the cookie every five seconds, and in the unload event.

However, I don't think there's anything wrong with updating it more frequently; try it.

SLaks
A: 

As long as you only need the information about the position if the page changes, it should be sufficient if you write the cookie only if the onunload-event of the window fires.

Dr.Molle