What is wrong with this code jsFiddle.
I have done everything that the example said, tried $('#navbar').scrollspy() but still no success.
Please Explain my problem and point me to a solution.
Thank you!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The ScrollSpy object needs to be attached to the element which triggers scroll events. In your current markup, that element would actually be the
<body>not the<table>element.Try removing the
data-spy="scroll" data-target=".nav"attributes from the table, and adding them to the<body>instead.Otherwise, if you want the
<table>to originate scroll events, it needs to have a scroll bar, i.e. fixedheightandoverflow: auto(which is how the Bootstrap Documentation Scrollspy example does it).Update
If you are placing the form in a modal, the element with the class
modal-bodyis going to be the one which triggers scroll events. Attach the Scrollspy object to it.