开发者

Scrollable Menu position on reload

开发者 https://www.devze.com 2023-03-24 09:34 出处:网络
I\'ve followed and successfully completed this tutorial in order to create a scrollable menu: \" http://valums.com/scroll-menu-jquery/ \"

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消