Sticky Navigation Bar On Scroll Using Vanilla Javascript | Fixed Navbar on Scroll

Поделиться
HTML-код
  • Опубликовано: 20 фев 2020
  • Enroll My Course : Next Level CSS Animation and Hover Effects
    www.udemy.com/course/css-hove...
    ------------------
    Join Our Channel Membership And Get Source Code Everyday
    Join : / @onlinetutorialsyt
    ------------------
    Please LIKE our Facebook page for daily updates...
    / online-tutorial-html-c...

Комментарии • 299

  • @top10information25
    @top10information25 Год назад +21

    You are making the code more simpler than others. thanks for making things better, easier, and simpler.

  • @fernandocoelho8791
    @fernandocoelho8791 2 года назад +10

    A true life saver. Thank you for this tutorial!

  • @gl5717
    @gl5717 3 года назад +14

    Responsive menu bar...
    The author is using flexbox in the video. To make it responsive you can start playing with css code like below. Then just remove "display: flex;" from the original header{...} and header ul{...} code sections.
    In the code below: If the screen is smaller than 768px, the menu items will stack vertically, else they will be horizontally in line. You can test for more sizes to be more specific when it comes to cell phones and tablets, etc.
    @media only screen and (min-width: 100px) {
    header, header ul{
    display: column;
    }
    }
    @media only screen and (min-width: 768px) {
    header, header ul{
    display: flex;
    }
    }

    • @MrArmyzero
      @MrArmyzero 3 года назад

      that one u can just adjust to max-width 767

  • @klaasjanssen644
    @klaasjanssen644 Год назад +2

    thank you so much, this was exactly what i was looking for, small simple JS projects, with great results! it helps me really a lot. thanks again :D

  • @justmentyou
    @justmentyou Месяц назад

    easy to use and make, tried from other youtubers but smth didn't came out, but after this video i made it. plus as a bonus there is a small piece of animation.
    thanks a lot

  • @dswp872
    @dswp872 3 года назад +27

    Seems simple but beautiful and lightweight. Thank you.

  • @imjordanhubbard1459
    @imjordanhubbard1459 3 года назад

    Incredible tutorial pal... thank you so much!

  • @mono_drift
    @mono_drift 4 года назад +13

    Finally something I wanted! :)

  • @polartitangaming1887
    @polartitangaming1887 3 года назад +42

    For those having issues with initial transition. I had the same issue. Just make sure the transition effect is in the right area of the CSS code. I kept putting it in nav when it needed to be in nav li. At least for my code it did. Hope this helps!

    • @chaitalinirgun1426
      @chaitalinirgun1426 3 года назад

      Means, where we have to put this

    • @lonewarrior2445
      @lonewarrior2445 2 года назад

      @@chaitalinirgun1426 In "nav li"

    • @satishchakma7555
      @satishchakma7555 2 года назад

      @@lonewarrior2445 Thank you. It worked. But can you please explain why it doesn't work on nav? Thank you.

    • @TonkFearsWomen
      @TonkFearsWomen 9 месяцев назад +1

      sir people like you are the reason the internet is a good place ty

  • @nguyencongquoc4436
    @nguyencongquoc4436 3 года назад +7

    This is what I need. Thank you

  • @adictade
    @adictade 3 года назад +4

    I have bin searching for this sticky nav. it is damnn helpful. Thank U so much. :+1

  • @jatulkumar9568
    @jatulkumar9568 3 года назад +4

    background music sun k nind aane lagri hai great work man :)

  • @le_seducteut_timide
    @le_seducteut_timide 3 года назад +16

    The way he combines Html, Css and javascript is just so clean

    • @AI_Elbaz
      @AI_Elbaz 3 года назад

      I think there is some repeated code in css, but the video is very helpful and simple.

  • @KaranPadaliya-nb1yf
    @KaranPadaliya-nb1yf 2 года назад +1

    Finally something I wanted! :)
    Thank you

  • @Ayoub_Himself
    @Ayoub_Himself 2 года назад +1

    Thank you for the tutorial, really helpful!

  • @SabirsCreation
    @SabirsCreation 3 года назад

    Wow unbelievable in 3 minutes I salute you

  • @olujobifolaranmi2133
    @olujobifolaranmi2133 2 года назад +1

    Great one, you did a good job. Thank you for this.

  • @siegfrieddallanzabader
    @siegfrieddallanzabader 4 года назад +41

    Unfortunately I am not a creative person even though I am a front-end developer but I can make-up with this lack watching your videos and your coding. So thank you very much sir.

    • @OnlineTutorialsYT
      @OnlineTutorialsYT  4 года назад +4

      Welcome bro :)

    • @donsonthewise
      @donsonthewise 3 года назад

      same here lol

    • @theultimatecoder3433
      @theultimatecoder3433 2 года назад

      same 😭😭

    • @adityaraut7
      @adityaraut7 Год назад

      Sir mai appse contact karna chahta hu

    • @adityaraut7
      @adityaraut7 Год назад

      @@donsonthewise sir college me full stack developer ke liye vaccancy Ari rhti hai
      To sir apne kaise job li ye puchna hai
      To sir ap apni mail id batayiye please

  • @codingwithobidjon1193
    @codingwithobidjon1193 Год назад +2

    Very good, thank you. I was looking for this for a long time😃

  • @lucassouzasilva6842
    @lucassouzasilva6842 Год назад +1

    Straight to the point very useful

  • @rain0sana
    @rain0sana 2 года назад

    Simple and understandable tutorial 👍

  • @alimy.5275
    @alimy.5275 Год назад

    Thanks man, you helped me out a lot! God bless you

  • @jamesmartinez9069
    @jamesmartinez9069 Год назад

    Online tutorials: Muchas gracias por su generosidad al compartir admirable conocimiento

  • @tarcaumarius9228
    @tarcaumarius9228 Год назад

    THE BEST TUTORIAL EVER LOVE YOU MAN

  • @strongmatter
    @strongmatter 4 года назад +1

    AMAZING!!!! THANK YOU !!!!

  • @muzaffartursunov1946
    @muzaffartursunov1946 2 года назад

    i really love online tutorials thanks aaaallllooottt

  • @danielkristensen5296
    @danielkristensen5296 Год назад

    Crazy simple!
    was a big help

  • @nanotech7431
    @nanotech7431 4 года назад

    Thanks sir you save my life 👍

  • @hariommourya2436
    @hariommourya2436 4 года назад +1

    You are my inspiration sir

  • @iamhtmldeveloper
    @iamhtmldeveloper 3 года назад

    Thank You bro for making videos for us :)

  • @SumoCumLoudly
    @SumoCumLoudly 3 года назад

    a video of speeded up typing, amazing

  • @user-eo7en6ec1o
    @user-eo7en6ec1o 2 года назад

    follow you from Egypt . You are the prof of web.

  • @solomonakpas
    @solomonakpas 5 месяцев назад

    So accurate and precise. Thanks

  • @bayudarmawan9220
    @bayudarmawan9220 3 года назад

    AWESOME!!! THANKYOU BRO!

  • @adaopedro2544
    @adaopedro2544 Год назад

    Straight to the point!

  • @echsfreshman
    @echsfreshman 4 года назад +1

    You made it so simple thanks player

  • @79jdv79nam
    @79jdv79nam 4 года назад +9

    I have suggestion to showing us how to make it "responsive" (if it's possible). Your works are great man!

  • @uthsarakawmini9793
    @uthsarakawmini9793 4 месяца назад

    its really helpful to me as a beginner

  • @ceylaan5466
    @ceylaan5466 3 года назад

    wow this is so good thx man ❤

  • @katalinalagosneuman5593
    @katalinalagosneuman5593 4 года назад +1

    Very good videos, I hope to see many more greetings.

  • @servercetin
    @servercetin 3 года назад

    Awesome tutorial. Thanks...

  • @suspiciousstick6310
    @suspiciousstick6310 4 года назад +4

    I know you are getting less views but please keep going it really helps a lot.....😎😎

  • @_PhanSiHoang
    @_PhanSiHoang 4 года назад

    Your video very useful, thks a lot

  • @geraldhaboc5601
    @geraldhaboc5601 3 года назад

    sorry I have an error. thank you for your wonderful tutorials

  • @shivpatel5991
    @shivpatel5991 4 года назад +1

    Epic thank you

  • @conrad9261
    @conrad9261 3 года назад

    This is really helpful

  • @Zoejohansendk
    @Zoejohansendk 7 месяцев назад

    So far so good: Now a question! How do I make the header, start as it’s own box/bar with color background, but NOT being on top of the image. But when scrolling down, it loose the background color, and goes on top of the underlying cover image and the rest of the page? ☺️

  • @gilbertoj.3507
    @gilbertoj.3507 3 года назад +2

    music: akashi ghandi White river

  • @GastonCassinaAllendes
    @GastonCassinaAllendes 3 года назад

    great! thank you!

  • @techbeast829
    @techbeast829 3 года назад

    thank u so much,,,, u saved the day

  • @rojasjahiker
    @rojasjahiker 4 года назад +1

    Thank u!!! you've save my life!

  • @greybluesea
    @greybluesea Год назад

    amazing, thank you so much!

  • @andreo5027
    @andreo5027 4 месяца назад

    incredibly great video

  • @ducthuy6685
    @ducthuy6685 4 года назад

    Amazing!!!

  • @psdzone
    @psdzone 4 года назад

    You're magic bro

  • @sionsebastian2501
    @sionsebastian2501 2 года назад

    looks amazing

  • @shahagamer8948
    @shahagamer8948 2 года назад +1

    Hello From Uzbekistan❤🇺🇿

  • @farruxeshboev9788
    @farruxeshboev9788 4 месяца назад

    thank you very much bro!!!!

  • @ahmadwildan4259
    @ahmadwildan4259 Год назад +1

    Thank you so much, this was exactly what i was looking for, small simple JS projects, with great results! it helps me really a lot. Good job bruh :D

  • @trishansaha8485
    @trishansaha8485 2 года назад

    very helpful thanks a lot

  • @dangminhtai
    @dangminhtai 4 года назад +3

    Love it

  • @shahabzafarinobari4156
    @shahabzafarinobari4156 4 года назад

    Love it

  • @angelesyo7076
    @angelesyo7076 3 года назад

    I really like all your videos, and about all this one. Unfortunatelly, it was not responsive

  • @bLitzKinG20
    @bLitzKinG20 Год назад

    Thank you so much!

  • @us28363hdhd
    @us28363hdhd 2 года назад +1

    Thank you so much ❤️

  • @gimhanrasanjana9578
    @gimhanrasanjana9578 Год назад

    Awesome!!

  • @princeessien5828
    @princeessien5828 5 месяцев назад

    Thanksgiving for this video

  • @_arunkmr_rr
    @_arunkmr_rr 4 года назад

    great!!

  • @fabiobaziota5919
    @fabiobaziota5919 3 года назад

    Amazing thanks...

  • @user-zp9iq1po5o
    @user-zp9iq1po5o 2 года назад

    Exciting!

  • @abaskisekka5137
    @abaskisekka5137 2 года назад

    It was so amazing

  • @tinsalada
    @tinsalada 4 года назад

    thanks a lot

  • @chaitalinirgun1426
    @chaitalinirgun1426 3 года назад

    Thanks alot 👍🏻👍🏻

  • @mohabedr5030
    @mohabedr5030 4 года назад

    I love it

  • @ragab0
    @ragab0 4 года назад

    عمل ممتاز
    Good job.

  • @therock3718
    @therock3718 3 года назад

    Thanks very much

  • @gixxerblade
    @gixxerblade 4 года назад +54

    position: sticky; also works really well.

    • @OnlineTutorialsYT
      @OnlineTutorialsYT  4 года назад +11

      Yes bro...

    • @dawidepl7807
      @dawidepl7807 4 года назад +8

      @@OnlineTutorialsYT I think he didn't get that it's mostly about that cool effect

    • @saumyaagarg4299
      @saumyaagarg4299 3 года назад

      @@OnlineTutorialsYT sir can u pls provide me with the bg pic?

    • @chiragsaini2314
      @chiragsaini2314 3 года назад +3

      hey the thing is that , when you apply position: sticky , you need to tell it when to be sticky , so set the top:0 in the same div , i hope that's gonna help , as it did help me.

    • @taric1664
      @taric1664 3 года назад

      @@chiragsaini2314 for me isn't working, could you help me? my menu is not turning white

  • @alejosandu
    @alejosandu 3 года назад

    Really cool

  • @user-ql2bc2gy5g
    @user-ql2bc2gy5g 3 месяца назад

    masha allah so helpfull video

  • @Beautiful.Nature.7736
    @Beautiful.Nature.7736 3 года назад

    thanks for this

  • @ijohntogun
    @ijohntogun Год назад +1

    God bless you bro

  • @stardust_crusaders4381
    @stardust_crusaders4381 3 года назад

    Brilliant

  • @asifhossain2088
    @asifhossain2088 2 года назад

    Thank you!!!!!!!

  • @dimaghabbash439
    @dimaghabbash439 2 года назад

    thank you so much .

  • @tranvuhoang7147
    @tranvuhoang7147 3 года назад

    thanks!!

  • @WebDevdai
    @WebDevdai 4 года назад

    thanks you

  • @ranakhalid7577
    @ranakhalid7577 2 года назад +3

    Plz tell me what should I do my script is not working even I write it very carefully and as it is as shown in video but still nav bar doesn't show any transition when I scroll down

  • @armaanraval5048
    @armaanraval5048 2 года назад

    Thank you so much

  • @amitkushwaha5763
    @amitkushwaha5763 4 года назад

    thanks bro

  • @rajantandan9723
    @rajantandan9723 4 года назад

    Thank u

  • @santoshmedok4781
    @santoshmedok4781 2 года назад

    Thank you

  • @pivotexpert9792
    @pivotexpert9792 3 года назад +2

    Hello, I used this. it works fine. but I noticed when I take the variables used in this function as global variables and I go to borwser and scroll down to some where on the page, then I reload the page while I'm scrolled on that position. and then, after reloading when I scroll to the top the sticky class doesn't toggles.
    But when I place the variables inside the function it self how you should in the tutorial it works fine.
    Why this is happens? I'm really curious to know.
    By the way. Thanks for giving us greate videos.

  • @carandapple328
    @carandapple328 2 года назад

    Nice tutorial

  • @juditcantosllavador7364
    @juditcantosllavador7364 3 года назад

    thank you!!!!

  • @romuloalves9349
    @romuloalves9349 4 года назад +3

    Ótimo vídeo parabéns 👌.

  • @sizanahmed9489
    @sizanahmed9489 2 года назад

    thank you so much

  • @jelly6656
    @jelly6656 2 года назад

    Thanks 😊

  • @bmhdtama3257
    @bmhdtama3257 3 года назад

    thanks,work

  • @underworld-of-gaming
    @underworld-of-gaming Год назад

    Thanks ❤️

  • @laiquemirza2407
    @laiquemirza2407 3 года назад

    keep going bro and just don't be afraid to put your face and voice it will be good to se that