Skip to content
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

FR: scroll such that it is on tab boundaries #4

Open
gregveres opened this issue Jul 22, 2016 · 1 comment
Open

FR: scroll such that it is on tab boundaries #4

gregveres opened this issue Jul 22, 2016 · 1 comment

Comments

@gregveres
Copy link

It would be nice if there was a mode where scrolling was only done on tab boundaries. Ie, if I page to the right, then the tab that is shown first in the list should be completely visible. This would help a lot with the aesthetics of the control as people are interacting with it.

@gregveres
Copy link
Author

I went ahead and implemented this. It can be found @ gregveres/bootstrap-nav-tab-scrollable (forked from here).
I don't expect that you will want to do a pull request because I didn't change this to be an option, I just implemented it so that it worked this way rather than landing on partial tabs.
You may want to look at the code though. I did a few things that you may want to bring into your code:
There was at least one place where you used width() instead of outerWidth().
I capture all the jQuery selectors into variables so that I am not doing the jQuery finds all over the place - especially during the manual scroll and resize event handlers.
I added a debounce (shamelessly taken from: jmosbech/StickyTableHeaders) to the scroll and resize handlers.

Anyway, thanks for creating this in the first place. This version works really well for my purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant