New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tabs - History #203
Comments
That's a great idea, and a useful feature. |
Unfortunately tabs present a much more challenging problem then the scrollspy plugin. Scrollspy checks scroll position and sets active state based on that (including page load). In browsers when you hit the back button (a hashchange) event is fired and you get scrolled to a previous position -- the scroll fires a scroll event, and we reset the active state to the correct place. Easy enough. With tabs the scroll position doesn't change because the content is being toggled in place. A work around is to manually check for a :target element on the page and to listen to the hashchange event for updates. The main problem with this approach is the hashchange event isn't supported by ie7. (which bootstrap needs to support) I wrote up a quick implementation of what this might look like however for those interested: https://gist.github.com/1217433 You can probably extend this with ben almans hashchange event plugin (which does pulling to look for a hashchange) However, because of the lack if ie7 support -- and because i don't want to add a pulling timeout to a plugin like this - i don't believe we will be supporting hash based navigation. Thanks for bringing it up however,and i hope that gist provides you with what you need to get something working if you feel you really need it. cheers! |
X-Ref: #2415 |
Looking at Bootstrap JS 1.3 WIP
It would be nice if you could link to a tab
Example:
index.html#tab3 when loaded would show the 3rd tab.
If you navigated from Tab 3 to 4 then it would also be nice if the back button took you to Tab 3, Much like the ScrollSpy.
Great work!
The text was updated successfully, but these errors were encountered: