fixel99 / tesla

my school tesla project
https://fixel99.github.io/tesla/
0 stars 0 forks source link

Question: Do you want to flag the current nav item as users scroll? #4

Closed russmaxdesign closed 7 years ago

russmaxdesign commented 7 years ago

@fixel99 , Something that may look good is to have the left nav items change to a current or active state when users scroll to the relevant area. For example, as users scroll down the page, the models nav item changes to "current" when the user hits this area of the page, etc.

Lots of libraries out there can be used to do this, such as:

http://scrollnav.com/

A rough example: https://jsfiddle.net/cse_tushar/Dxtyu/141/

fixel99 commented 7 years ago

This is something I definitely want to implement. The rough example looks like exactly the thing I want (Maybe even the smooth scroll, but I would need to test it on my website before being sure that I would want to keep it) however, I think you are going to need to explain what is going on a bit; it's been a while since I last used javascript and I haven't used it a lot when implementing it in website design, so I'm not super clear on what is going on with a lot of it.

fixel99 commented 7 years ago

@russmaxdesign Ok so I eventually realised that the code from the jsfiddle was actually JQuery. I have looked at the basics and understand how the active class is being toggled on and off (the smooth scrolling is a different question), so I am going to try and implement it in.

fixel99 commented 7 years ago

@russmaxdesign I have tried to implement this in however it appears nothing is happening, I understand almost all of the code, but am not sure how to debug or properly test using JQuery as I am unfamiliar with it. Do you think you could take a look at it when you have a spare moment?

russmaxdesign commented 7 years ago

@fixel99 I am no JavaScripter but may be able to help. Have you pushed anything into your site for review?

fixel99 commented 7 years ago

Yes, everything is in the last commit.

russmaxdesign commented 7 years ago

@fixel99 Chat via skype or phone later this evening if you want.

fixel99 commented 7 years ago

@russmaxdesign I'm actually pretty busy with an assignment until the end of school, but will be finished by the weekend.

russmaxdesign commented 7 years ago

No worries... whenever you want...

fixel99 commented 7 years ago

@russmaxdesign Looks like bootstrap's scrollspy plugin can do this, however it is only referenced in their v4 alpha documentation (https://v4-alpha.getbootstrap.com/components/scrollspy/) and I can't find a download link, so i'm not sure if it is built into v3 or not. Any ideas?