kswedberg / jquery-smooth-scroll

Automatically make same-page links scroll smoothly
MIT License
1.97k stars 427 forks source link

Problem with afterScroll and .scroll() for the first scrolled element #70

Closed shaundrake closed 8 years ago

shaundrake commented 9 years ago

I thought it would be nice to highlight the element being scrolled to. I highlighted the scrolled-to heading by adding a class with a brighter color. Then I added a function that turns it back to the original color when the browser window is scrolled by the user (going back to the navigation). It works for every heading except the first.

I did some troubleshooting and eliminated my own coding. The problem is that for the first element only, it's triggering the .scroll() without the user scrolling the browser window. Possibly the function is still scrolling.

I apologize because I have a very limited understanding of javaScript and Jquery, so I'm sure that my code is clumsy looking.

http://www.dentalbrandingclients.com/premium/henry_schein_bpo/marketing.html

Thanks for any input.

kswedberg commented 9 years ago

Sorry for taking so long to reply. I just looked at the URL you pointed me to, but I'm not seeing your attempt to highlight the element being scrolled to.

kswedberg commented 8 years ago

@shaundrake : any word on this? Shall I close the issue? Or is there something you still need?

shaundrake commented 8 years ago

Never got it working and went another way. This was almost a year ago. I no longer work in the industry.