flesler / jquery.localScroll

Animated anchor navigation made easy with jQuery

Home Page:http://demos.flesler.com/jquery/localScroll/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

loading initial hash value on load

robbyking3 opened this issue · comments

Hi,
I'm using the plugin in a single page app using knockout js.

I have a URL structure like this:
http://1.2.3.4:1111/user#/ViewItems/fa4d9583-6e37-470b-9974-07f771ee329d/what

and I have 4 sections called:
what, where, when, who

all of which are wrapped in a long horizontal rectangle, and using localscroll to scroll to each view.

the problem is if I want to load a section just on load, so if a user copies the url, or they even reload the page.

since it's not using traditional hashing, is there another way localscroll can recognize each section?

Hi, LocalScroll addresses a very standard situation and provides a very simple solution for it. In your case, you could take just jQuery.scrollTo (which is used by localScroll) and re-implement this part in a way that suits your needs, I think it shouldn't take much code.