ScrollSpy Using HTML CSS & Vanilla Javascript

preview_player
Показать описание
how to make a simple scrollspy effects using html css and vanilla javascript.
create a simple scrollspy using pure javascript.
how to add and remove active link from navigation links on scroll using javascript.
add / remove active links in navigation bar on pages scroll

New To My Channel Subscribe Now And See More Stuff Like This:

#ScrollSpy
#Javascript
#ScrollEffects
Рекомендации по теме
Комментарии
Автор

One of the best CSS Youtubers. Your content is 100% gold.

fernandosalas
Автор

Nice. Now there's also intersection observer that I think would work best on this scenario though.

taksumaq
Автор

Thanks bro ... its work,
for anyone here new at javascript like me, you must specify the DOM selector, in my case :
let navLinks = li.nav-item a');

dpcandra
Автор

Hello dear we need it also with hamburger menu when scrolling it changes depending on the page title please

aytech
Автор

Finally done thank u so much for such amazing video....Thanks a lot sir..

Muskan-mcdv
Автор

Is it possible to create all kinds of sliders and all kinds of Carousel using JavaScript?

yeasinarafat
Автор

May I know what the z-index on the header element is 1000?

Kaitlynli
Автор

Kya aap mjhe teach krskte hqin mjhe itni know how hai but thori problem hai main aap ko pay krdnga...

waqasalam_
Автор

The smooth scrolling effect doesn't work Mac os and safari, Mr web designer can you please make video for smooth scrolling for Safari and Mac os

nikhilpatel
Автор

mujhe apne search result m 2 videos mile but 2nd one was quite lengthy and complex lgi ..thats why i m here ....everything was fine but coudnt got line 51 and end with that error... i m beginner in js.. i have to learn it by myself ... thats why i m not using jquery... i need pure js code plz someone help me out..

Muskan-mcdv
Автор

line number 51 wali code m mujhe error aa rhi ...plz koi line 51 explain kr dijiye
mujhe not a valid selector error aa rahi bar bar

Muskan-mcdv
Автор

Bhai plz floral decor. ie website banana shikhado plz

sychofamily
Автор

vai wordpress theme design html css javasript php mysql

LoveStoryFirst
Автор

vanilla kahan use hui hai isme ye to pure js hai

Muskan-mcdv
Автор

Uncaught TypeError: Cannot read properties of null (reading 'classList')

CODE -
let section =
let navLinks = ul li a')



window.onscroll = function(){
section.forEach(sec => {
let top = window.scrollY;
let offset = sec.offsetTop;
let height = sec.offsetHeight;
let id = sec.getAttribute('id');

if(top >= offset && top < offset+height){
navLinks.forEach(links =>{

document.querySelector('nav ul li a[href*=' + id +
})
}
})
}

uniqueyroasts
join shbcf.ru