How to change your navigation style on scroll

Sdílet
Vložit
  • čas přidán 29. 08. 2024

Komentáře • 198

  • @user-nc7tk3ee3q
    @user-nc7tk3ee3q Před 5 lety +103

    Please don't stop this series, it is amazing and it really helps alot !

  • @pieter-venter
    @pieter-venter Před 5 lety +5

    Your videos never seem to amaze me. CZcams is full of videos on the basics of CSS but your videos focus on the more advanced things that people might not even have heard of.
    Thank you for that!

  • @cintron3d
    @cintron3d Před 5 lety +6

    Thank you so much! I thought I knew CSS and JS but then I started seeing these sites with fancy transitions and didn't know how they were achieving that look. This video is so helpful thank you!

  • @ramadanmoheyeldeen6252
    @ramadanmoheyeldeen6252 Před 4 lety +20

    You're the best instructor I have ever see, you deserve more than the best and I have learned a lot form you.

  • @SuperSaiyanScandinavian
    @SuperSaiyanScandinavian Před 4 lety +1

    I dunno if you read the comments much, or if there are just too many comments to sift through, but i just wanna say your channel is absolutely fantastic. It's specifically your channel and DevEd that I come to all the time to learn new css tricks. im still relatively new to web development and am finishing up my first fullstack site. but the thing that has lacked in all my education is styling. you guys have helped me to make my site and other demo stuff I've done recently look so much better than my earlier stuff. honestly if I land a job because of my portfolio, you guys are to thank. As a matter of fact, once I get my portfolio site going, i'm going to credit you guys in my about me section.

    • @KevinPowell
      @KevinPowell  Před 4 lety

      I do my best to read them all :)
      Glad that you enjoy my content, and thanks for taking the time to let me know :D

  • @blonduose
    @blonduose Před 4 lety +7

    Lovely, thanks, finally finished my product landing page with a few JS tweaks so it looks nicer :)

  • @devine_noise
    @devine_noise Před 2 lety

    Had some problems with Gulp CLI on my Windows machine. If you're running into an issue with 'gulp watch' not working, you can make the scss file a css file, delete the package.json, node_modules, package-lock.json, and just remove all "&" (&:after becomes .nav__link::after) in the css and replace it with the parent css class and use Live Server extension to get auto page reload in the browser. Clean up your curly brackets in the CSS and everything works. Thanks for making this Kevin, love your teaching style.

  • @nuqtamedia1294
    @nuqtamedia1294 Před 2 lety

    I just spent 3 hours trying to wrap my head around this with no results. Then I found your video and it all makes sense now! Thanks a ton!!!

  • @MARVTOBI-wz8qk
    @MARVTOBI-wz8qk Před rokem

    Been battling on this for days now and just came across your channel... It's really helpful, thank you.

  • @KarolD666
    @KarolD666 Před 3 lety

    This saved the last hair I have after trying to fix a previous "successful attempt" of background switching. Thank you.

  • @pauljohn3898
    @pauljohn3898 Před 3 lety

    Ever wondered How this comes true and your video Help a lot!

  • @Fliteska
    @Fliteska Před 5 lety +3

    Also wondered how sites did that, figured it would be much more than that! Will definitely try this out.

  • @muhammadraza2940
    @muhammadraza2940 Před 2 lety +1

    Fantastic video! Really clean way to manage scroll events. Definitely my go to method now. Thanks a ton for this!

  • @tarekjamanlabu9773
    @tarekjamanlabu9773 Před 3 lety

    Finally figured it out, thanks 'The King of CSS' ❤️

  • @cervece41
    @cervece41 Před 4 lety +1

    You're a lifesaver, outstanding channel, I can't stop watching and liking your videos!!

  • @NERO-ez1mn
    @NERO-ez1mn Před 3 lety

    seriously the 1st vid of theory is difficult for me to understand maybe because i'm a newbie but after this part i see it clearly that we are talking about the observe() native function all along hahahahahaha THANK YOU REALLY SO MUCH you deserve more subs.

  • @MegaPupizoid
    @MegaPupizoid Před rokem

    Thanks you help me to learn Javascripts from scratch knowledge 😀

  • @tasteoftheair
    @tasteoftheair Před 3 lety

    Thank you for a great video! As a beginner, I was struggling to change text color of anchor links. Had to look at Kevin's code on github for the solution. It turned our than css 'color: inherit;' on each anchor link (there is a class for each like) solves it.

  • @ikhyeonkim4372
    @ikhyeonkim4372 Před 5 lety +9

    This is awesome! You’ve got everything that I looked for.

  • @danielChibuogwu
    @danielChibuogwu Před 2 lety

    Thanks for this series

  • @adrian20065
    @adrian20065 Před 5 lety +1

    Awesome! This is really practical and something I can use - credit to Kevin Powell.

  • @BarthObiefuna
    @BarthObiefuna Před 3 lety

    You are a good teacher.

  • @suhrobmuboraksho
    @suhrobmuboraksho Před 2 lety

    Thanks Kevin. Great tutorial!

  • @deniskotov
    @deniskotov Před 3 lety

    Ohhhhh!!!! This trick solved so many problems for me! Thank you, Kevin!

  • @zachfenton608
    @zachfenton608 Před 3 lety +1

    Perfect just was i was looking for, ill sleep and apply it to my site

  • @jamesa.
    @jamesa. Před 4 lety

    Thanks a lot! I didnt even need to watch the intro video and I fully understood!

  • @robertwattner
    @robertwattner Před 3 lety

    Now we need to offset anchor links to accommodate the sticky header height. Not the margin-top: -100px: padding-top: 100px; to every anchor
    Awesome video btw! Your videos are the best!

  • @utkarshkukreti239
    @utkarshkukreti239 Před 3 lety

    Thank you so much. Great. Root margin concept was very sexy!

  • @zakariaelkhachia1533
    @zakariaelkhachia1533 Před 4 lety

    Thanks Kevin! Been looking for this for quite sometime!

  • @pallavisingh62
    @pallavisingh62 Před 3 lety

    These videos are so helpful! Thank you for making them!

  • @_vikramhegde_
    @_vikramhegde_ Před 5 lety

    I'm in love with Intersection Observer.. Just amazing 👍👍👌

  • @gabeadams2926
    @gabeadams2926 Před 5 lety +2

    Thanks for sharing this Kevin! Much appreciated :)

  • @ARTICFR0ST
    @ARTICFR0ST Před 5 lety

    Didnt think of this idea until you made a video about it. Thanks for thinking ahead haha

  • @HeyTylerMartin
    @HeyTylerMartin Před 2 lety +1

    Are you only using CSS variables for demonstration purposes, or is there another reason you're choosing CSS variables over SASS variables when you're already using SASS? Still learning, just trying to wrap my head around it all 😅

  • @DamianDemasi
    @DamianDemasi Před 3 lety

    Great tutorial! Thanks!

  • @mrmamun5830
    @mrmamun5830 Před 5 lety +5

    Just amazing! I'm going to copy those JS codes 😁

  • @philkewley
    @philkewley Před 2 lety

    Every time I start a new project I find myself having to go back through your library of videos, gradually what I am learning is starting to stick, although I still struggle to remember even the most simple instructions! - one thing from this video, is how are you changing the background image in the big hero section, I swear every time I look at the video it's a different Unsplash image but I can't find how you're doing it within the CSS. Thanks as always for sharing

  • @greysaga
    @greysaga Před 2 lety

    thank you for this great tutorial!

  • @DamienPeden
    @DamienPeden Před 5 lety

    I just did a menu shrink effect on scroll and its super buggy! This definitely fixes those issues! Thanks!

  • @abdulrehaman2406
    @abdulrehaman2406 Před 5 lety +1

    Are you a mind reader or what 😅 I was stuck on this topic today and wanted to find a solution. I open CZcams and bam ! There is your video to fix my problem 😍 This happened thrice till now 👍🏻

  • @underdog3864
    @underdog3864 Před 4 lety +4

    Epic! I was trying to do it the old way with offsetTop. This is so much easier

  • @rebelmachine88
    @rebelmachine88 Před 5 lety

    Fantastic series and a great video, Kevin!

  • @misterkilluminati6949
    @misterkilluminati6949 Před 3 lety

    beautifully done

  • @k.jflacko5720
    @k.jflacko5720 Před 3 lety

    This was really helpful!

  • @AllenMarsam
    @AllenMarsam Před 3 lety

    Thanks for your tutorial

  • @aqua123670
    @aqua123670 Před 5 lety

    Yess ! have been waiting for this. Thank you

  • @andersonalmeydat7715
    @andersonalmeydat7715 Před 3 lety

    amigo eres mi héroe muchas gracias, pude cambiar totalmente el estilo del nav y hacer un super efecto, buen tuto!!

  • @sofienebb
    @sofienebb Před 2 lety

    Ya it cuming after three years, but you have helped me a lot, so thank you ;)

  • @royhyde8842
    @royhyde8842 Před 2 lety

    That was a lot of fun

  • @AbhishekKumar-mq1tt
    @AbhishekKumar-mq1tt Před 5 lety +1

    Thank u for this awesome video

  • @christianaltan4913
    @christianaltan4913 Před 3 lety

    Great Video! really really useful

  • @giovannipizzato6888
    @giovannipizzato6888 Před 4 lety

    Helped me a lot, thanks man!

  • @truedivan
    @truedivan Před 4 lety

    Tnx from Russia!) Great and simple

  • @gabiold
    @gabiold Před 4 lety

    Awesome! You could get the header's offsetHeight to set the options.

  • @NoTengoIdeaGuey
    @NoTengoIdeaGuey Před 2 lety

    Take a drink every time he says "I've a got another video for that subject already" and you'll be as drunk as i afgbnq

  • @RyanEwanchuk
    @RyanEwanchuk Před 3 lety +2

    Got a question for you. This works great, but it only works for one section. Let's say I have a bunch of sections with a class called "black-section" and I wanted the navigation to change every time it intersected with one of those sections, what code would I have to change?

  • @jamjam3448
    @jamjam3448 Před rokem

    Thank you ☺️

  • @rahibharoon7852
    @rahibharoon7852 Před 3 lety

    Kevin Powell you great really like you videos it's very informative and technical and easy to understand for us. can we use intersection observer API in Reactjs?

  • @joshuatao7020
    @joshuatao7020 Před 5 lety

    Your videos are always amazing!Thank you,sir ❤️❤️❤️

  • @jvoyager1
    @jvoyager1 Před 4 lety

    This is awesome, thank you!

  • @majgajsek7818
    @majgajsek7818 Před 2 lety

    Thank you good sir :D

  • @abdillahsyafiq
    @abdillahsyafiq Před 3 lety

    can't wait to implement this in my projects!

  • @SaleKnezevic
    @SaleKnezevic Před 5 lety

    Great work, Thank you.

  • @kostyantinbilyznyi3496

    Thanx! You helped me a lot!

  • @tux8345
    @tux8345 Před 2 lety

    wow, you save my life!

  • @saydurrahman1899
    @saydurrahman1899 Před 5 lety

    Can you please make a video on responsive Mega menu with really nice animation. This series has been absulutly amazing. I am Learning so much. Thank you for your hard work.

  • @J90JAM
    @J90JAM Před 3 lety

    Why CSS Variables and not SCSS Variables? Another awesome video.

  • @DavidNitzscheBell
    @DavidNitzscheBell Před 5 lety +1

    These Intersection Observers are really handy. Have they been around forever and no one knew, or are they something new or newly supported?

    • @KevinPowell
      @KevinPowell  Před 5 lety +2

      They've been around for a little bit (not that long), but browser support has only recently really come around (Safari just started supporting it in their latest release). IE doesn't obviously, but there is a polyfill, which I'll do a short video on to wrap up the series.

  • @mrrolandlawrence
    @mrrolandlawrence Před 4 lety

    smashing series. am literally deleting massive of legacy code from projects :)

  • @alinawaz4034
    @alinawaz4034 Před 5 lety +1

    Very good!!!

  • @carolinaklein4946
    @carolinaklein4946 Před 4 lety +3

    Does anyone else get this error for the last line of JS " sectionOneObserver.observe(sectionOne) " ?
    TypeError: Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'.

    • @festusribiro6018
      @festusribiro6018 Před 4 lety +1

      Yes I did, still trying to get the solution.

    • @object_name
      @object_name Před 3 lety

      @@festusribiro6018 Mybe you have no element with the class 'home-intro' or you had a typo on the second line.

    • @tejasjoshi1907
      @tejasjoshi1907 Před 3 lety +1

      Did you find that solution?? I m stuck in that

    • @turtleshell0
      @turtleshell0 Před 2 lety

      @@tejasjoshi1907 me too :(

  • @sithumdasantha3147
    @sithumdasantha3147 Před 3 lety

    Thanks Man 🤍

  • @Darival92
    @Darival92 Před 5 lety

    Great videos kevin

  • @noahsscott
    @noahsscott Před 5 lety +1

    Just found your channel. Thank you for these! Would be interested to see intersection observer used for a table of contents say for a wiki or one-pager. I'm trying to assemble one myself with IO but struggling.

    • @vijaydhravida
      @vijaydhravida Před 5 lety

      Any luck on this front @noahScott ? I am trying the same, so if you have any insights I would very much be interested to know.

  • @mahvaree
    @mahvaree Před 2 lety

    Thanks

  • @Billiam112
    @Billiam112 Před 4 lety

    That's cool, thanks for sharing! Apparently, it is not supported by ie11, so my question to you is: would you go for listening to scroll event if you had to support ie11 or would you do it in some other way?

  • @GiancarloCarccamo
    @GiancarloCarccamo Před 2 lety

    great video

  • @wtfcactus
    @wtfcactus Před 3 lety

    Im late for this video but also a beginner in programming, i didnt understant 1 thing, is this code vanilla javascript or is it another framework?

  • @Juan-lj4pi
    @Juan-lj4pi Před 4 lety

    You're awesome dude

  • @whatthefunction9140
    @whatthefunction9140 Před 3 lety

    Nice sass

  • @WebDeveloper682
    @WebDeveloper682 Před 10 měsíci

    perfect!

  • @emrysblack
    @emrysblack Před 3 lety

    I would have used classList toggle, and passed in entry isintersecting bool to to keep code clean and tidy

  • @rework7562
    @rework7562 Před 11 měsíci

    At time-index 7:17 the "sectionOneObserver" is put as an argument in its instance. What does this exactly do?

  • @Eben_Haezer
    @Eben_Haezer Před 3 lety

    do you have any video on how to hide horizontal scrollbars that appear when vertical scrollbar appear. i don't know what i'm doing wrong

  • @valentinfigueiredo
    @valentinfigueiredo Před 3 lety

    hey ! thanks for the video! i want to know if its possible to do without sass? thanks

  • @clpr635
    @clpr635 Před rokem

    thanks

  • @Franiveliuselmago
    @Franiveliuselmago Před 4 lety

    I'm trying to find the video about how to highlight the menu element of the current section. Help please.

  • @franco-cespi
    @franco-cespi Před 4 lety

    I love it!

  • @eUploads
    @eUploads Před 3 lety

    Imagine if this became a CSS feature.
    @intersection observer (*element to look for if is on screen*) {
    CSS code
    }

  • @kensleylewis
    @kensleylewis Před 3 lety

    In connection to this great exercise, is it possible to a parallax effect with this technique (i.e. as you scroll down the page the background image scrolls slower)?

  • @upsylondeveloppement8837

    Great ! Thanx Kevin ;-)

  • @pasizdobrekuce
    @pasizdobrekuce Před 4 lety

    Nice one. Works great, but what when there's not intro section in DOM?

  • @DanSinor
    @DanSinor Před 4 lety

    What would the "const sectionOne = document.querySelector(".home-intro");" be if I wanted to target and trigger off of section ID (services) rather than CLASS (bg-dark)? As in example (). Would it use ("#services")?

  • @dimensionalpotential
    @dimensionalpotential Před 4 lety

    But Kevin et al, if I need to differentiate between scrolling down and scrolling up - is there an alternative to a JS scroll watcher in that case?

  • @cano5063
    @cano5063 Před 4 lety

    so the advantage of intersection observer instead of event-listeners is that it is faster at loading?

  • @xades971
    @xades971 Před 3 lety

    Probably a silly question but how is that border on the nav elements made? Where it starts from the middle and stretches out to the end points. I'm looking through the repo but I can't seem to get my head around it

  • @acai4171
    @acai4171 Před 3 lety

    Weird, for me it adds the class but the new CSS properties don't apply to it.
    Also, I when I exit the section again, the class isn't being removed. Any ideas?

  • @akanshamotwani3646
    @akanshamotwani3646 Před 4 lety

    Hi Kevin, how would the intersection observer work with position sticky of CSS. Instead of the elements in the viewport, I need to observe the element which currently is stick on the top. Amazing series though!

  • @shuukeyare8388
    @shuukeyare8388 Před 4 lety

    What a fantastic tutorial!!!!! But what about browser compatibility is it working with all of them????

  • @timhart6061
    @timhart6061 Před 3 lety

    Hi! I was wondering where do u put transition on when u scroll back up? I put transition on the .nav-scrolled only so when i scroll down the transition works but when i scroll back up it just removes instant