aidanlister / jquery-stickytabs

Provides persistant state (back and forward button support) for Bootstrap tabs
http://aidanlister.com/2014/03/persisting-the-tab-state-in-bootstrap/
MIT License
60 stars 33 forks source link

scroll to top is confusing on long pages #18

Open timabell opened 9 years ago

timabell commented 9 years ago

Hiya,

We now have the workaround for the unwanted scrolling down to the tab (pr #11), however I think we've created a different problem as a result.

The scroll to top is happening even when you already are on the page and just switching tabs. I don't think it should scroll at all when you already have the page open (easier said than done I know).

To see what I mean:

this is in firefox.

timabell commented 9 years ago

perhaps @jabbtech could pile in on this one?

curtisweeks commented 9 years ago

Hey @timabell!

Having the scroll to top always happen can be useful in instances where there is a desire to switch tabs while at the same time keeping a sites primary navigation at the top of a page in view. It wouldn't be too difficult to expand the backToTop option though, we could address the issue you described by passing the desired behavior like:

backToTop: always | onload | none