scrollspy bugs
See original GitHub issuehey, i am having a ton of issues getting scrollspy to work properly.
Issue 1:
$('.navbar').scrollspy({offest: 70});
Changing the offest and then clicking on the links does nothing. It refuses to acknowledge the offest when you click the links although it does respect the offset when you are scrolling down the page.
Issue 2:
$('.navbar li').on('activate', function(){console.log('activate')});
This callback does not get called because of this line, which I’m guessing always evaluates to true.
if ( active.parent('.dropdown-menu') ) {
active = active.closest('li.dropdown').addClass('active')
}
Also, I am getting weird behavior where one of the last nav element is auto selected.
Issue Analytics
- State:
- Created 11 years ago
- Comments:18 (1 by maintainers)
Top Results From Across the Web
bootstrap scrollspy bug when resizing browser - Stack Overflow
Use the navbar. (notice that the url has changed to include #section ) this only occurs if you resize the browser. This causes...
Read more >Bug: Vanilla Bootstrap Scrollspy not working after including
scrollspy ({ target: '#main-navbar', offset: 50 }) }); I tied it not even working by javascipt instead of data api. The movement I...
Read more >Scrollspy activates links erratically - Bootstrap Studio Forum
It seems like Scrollspy activates the links in a very erratic manner. ... Scrollspy activates links erratically · Bug Reports.
Read more >CSCvq93771 - Bootstrap scrollspy Data-Target ... - Cisco Bug
Bug information is viewable for customers and partners who have a service contract. Registered users can view up to 200 bugs per month ......
Read more >Scrollspy nav BUG - YOOtheme Support
Scrollspy nav BUG. hi,. uikit documentation. yootheme pro documentation. I found out that Scrollspy nav (https://getuikit.com/ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So this is how I got it to finally go to the proper place when you click on the navigation. I added an event handler for the navigation clicks. Then you can just use “scrollBy” to move up on the offset.
@bluepines’ code works great, thanks!