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

change scrollspy documentation to clarify javascript usage #6247

Merged
merged 1 commit into from Dec 22, 2012
Merged

change scrollspy documentation to clarify javascript usage #6247

merged 1 commit into from Dec 22, 2012

Conversation

jimwebb
Copy link
Contributor

@jimwebb jimwebb commented Dec 12, 2012

The scrollspy documentation suggests calling a scrollspy instance in JavaScript with the following code:

$('#navbar').scrollspy();

This is wrong unless #navbar is what's scrolling. Scrollspy is invoked on what's being spied, not on the target. What I think the author means to say is:

$('body').scrollspy({ target: '#navbar' });

I've changed the documentation to reflect this, and to state that the scrollspy script is specifically looking for .nav li > a, which may be confusing for folks who tweak the standard nav component.

Mentioned in this bug:
#5553

This is my first pull request; holler (nicely, please) if I've done something incorrectly.

fat added a commit that referenced this pull request Dec 22, 2012
change scrollspy documentation to clarify javascript usage
@fat fat merged commit 356e47e into twbs:3.0.0-wip Dec 22, 2012
@fat
Copy link
Member

fat commented Dec 22, 2012

cool thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants