I've followed and successfully completed this tutorial in order to create a scrollable menu:
" http://valums.com/scroll-menu-jquery/ "
My problem is that I need the menu to stay in the same position after a new page is loaded rather than reset itself.
An example of the menu can be found here: " http://valums.com/files/2009/menu/final.htm "
As you can开发者_JS百科 see, the menu resets itself to the far left every time the page is refreshed. I need my menu to stay in the same position.
Any help would be appreciated!
At the bottom of the instructions there's the following code:
var left = (e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth;
div.scrollLeft(left);
You can store the left
variable and, on page load, do div.scrollLeft(left)
.
精彩评论