Lazy-Loaded Images - Code This, Not That

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024

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

  • @gerritweiermann79
    @gerritweiermann79 5 лет назад +33

    Thanks for the new thing that will be stored in my head somewhere :D
    I really like the Code This Not That series. Please continue doing this!

  • @SprHero
    @SprHero 5 лет назад +81

    I didn't know this existed. Thanks for the clear and to the point video! Looking forward to your next one 😉

    • @Fireship
      @Fireship  5 лет назад +3

      Nice, it's one of my favs :)

    • @LOOTS243
      @LOOTS243 5 лет назад

      @@Fireship easy thread gains 💪💪

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

      Me too haha. I just watched the react one and this popped up. Quite the Gem too. I always avoided these flashy browser API because of support. Guess I'll be having fun with the observer and the polyfill

  • @RahulSingh-rr9hx
    @RahulSingh-rr9hx 3 года назад +1

    Thanks dude, for not making 20000000000mins long video with unnecessary explanation. Thanks for keeping it Lit 🔥🔥

  • @ArabianAK
    @ArabianAK 5 лет назад +5

    Found your channel recently and I love it! Keep on keeping on.

  •  5 лет назад +1

    Absolutely love all of our videos Jeff!
    Thanks for your hard work and thanks for being amazing.

    • @Fireship
      @Fireship  5 лет назад

      Thank you Kevin :)

  • @isaacdiaby
    @isaacdiaby 5 лет назад +4

    Fire ship🔥 actually love your videos, it gets to the point and just teaches you what you need to know. I needed this for my app, huge thanks man

    • @Fireship
      @Fireship  5 лет назад

      Great to hear, thanks for watching!

  • @anawhite2562
    @anawhite2562 4 года назад +10

    Jeez, I think this is literally the first time I had to set speed at 0.75. Usually, I watch at 1.5 - 2. Still, thanks. Subscribed

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

      Welcome to the channel!

  • @saadabbasi2063
    @saadabbasi2063 5 лет назад +6

    I appreciate that you changed your videos thumbnail, seems like everybody started using similar to what you had previously. 😃

    • @Fireship
      @Fireship  5 лет назад +1

      I know, I see that design everywhere now. This design is harder to copy :)

  • @amirfawzy1147
    @amirfawzy1147 5 лет назад +4

    first time to know that there's something called IntersectionObserver in javascript ... very good tip and efficient

  • @ImperiumLibertas
    @ImperiumLibertas 5 лет назад +4

    Absolutely outstanding quality. Thanks again Jeff!

  • @pb1431985
    @pb1431985 5 лет назад +1

    Quick demo and useful information that can be implemented in any real life project

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

    Brilliant! I really needed this guide, really helped make my code become more efficient; in fact, this whole series "Code This Not That" is amazing!

  • @salmanwap
    @salmanwap 5 лет назад

    This is first time I am watching your video. And within 10 seconds I subscribed to your channel. I am coding that for a long time, now I am starting to code this not that. Thanks for the video.

  • @sivuyilemagutywa5286
    @sivuyilemagutywa5286 5 лет назад

    I don't know why I always press like before even watching your videos.
    Is it because your videos are short and straight to the point --> Yes
    Or clear and Clean --> Yes
    Or no unnecessary boilerplate --> Yes
    Or your content is unmatched --> Yes
    I guess I will never know

  • @nicholassaephanh4407
    @nicholassaephanh4407 5 лет назад

    Dude I haven't touched code in a while and you make me hyped up to code lol. This is SO good.

  • @belahcenebenzaratahar5708
    @belahcenebenzaratahar5708 5 лет назад

    Thank you for not wasting my time! short and yet covering it all.

  • @naga2054
    @naga2054 5 лет назад +2

    Thanks Jeff as usual great video.
    My expectation from you is always #LearnWhatYouDontKnow 😍

  • @Shivamethical
    @Shivamethical 5 лет назад +3

    Hi I found a minor improvement for the same code when we are writting bad code that time -
    const src = img.getAttribute('data-lazy');
    if(src) {
    // null check here
    img.setAttribute('src', src);
    img.classList.add('fade');
    }
    If we dont check null so it will make null network requests . :)
    Thanks very useful contents.

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

      I know this is an *old* comment, but fyi, you could also modify the original query selector to “img[data-lazy]” to ensure that every image received has a data-lazy property(though a null check is still good in case it changes somehow after attaching the listener).

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

      @@aarond309 Yeah Good.

  • @FinlayDaG33k
    @FinlayDaG33k 5 лет назад

    This is a really nice thing that I did not consider myself yet.
    I've opened a ticket/issue on my own website repo so I'll have a look at it later again when the time is right.
    Keep up the good work!

  • @akashrajpurohit97
    @akashrajpurohit97 5 лет назад

    I like this 'Code this, Not that' section alot.. keep em coming🙌

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

    Jeff is my favourite tech youtuber!

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

    This video is amazing mate!
    Thank you for this quality content. Keep it up!

  • @kangqian8288
    @kangqian8288 5 лет назад

    Always love your channel on angular typescript :)

  • @chriswindsor1417
    @chriswindsor1417 5 лет назад

    Great video! Love this kind of content. You explain everything so effectively and timely.

  • @mateja176
    @mateja176 5 лет назад

    Such an outstanding ambassador of JavaScript 👑

  • @Blagel97
    @Blagel97 5 лет назад

    Really thorough walkthrough! Love your vids man

  • @idlevandal69
    @idlevandal69 5 лет назад

    This is a game changer.. I usually avoid scrolling animations, not anymore!!!

  • @zeeshanmh215
    @zeeshanmh215 5 лет назад

    Very clear and concise tutorial. Waiting for more like this 😍

  • @leodevbro
    @leodevbro Год назад +3

    3:56 - You used observer.disconect, because you created observers for each element, but why don't we just create only one observer and then unobserve each element with observer.unobserve(entry.target) ?

    • @MercurySteel
      @MercurySteel 13 дней назад

      The real question is why we're iterating over the entries when each observer is supposed to have only one entry.

  • @lutaseb
    @lutaseb 5 лет назад

    did implement infinite scroll using the magical exaustMap() operator of rxjs, it worked like a charm, but did not have any images needing lazy loading or stuff. Thanks for your videos which just the best on youtube

  • @PaurakhSharma
    @PaurakhSharma 5 лет назад +1

    Thank you for these amazing videos.

  • @freeeedl
    @freeeedl 5 лет назад

    Thx for all your stuff. I like your style and also listen to your voice ^^

  • @SamuelCamargo1000
    @SamuelCamargo1000 5 лет назад

    Thanks for this subject. Added a lot to my dev repository knowledge.

  • @thepotatokitty
    @thepotatokitty 5 лет назад

    I was browsing through RUclips for some angular tutorials, found you... Best channel for the angular and firebase tutorial, coz ur video contains quality content not 💩 :-P

  • @zidalo
    @zidalo 5 лет назад

    Great video!
    I want that t-shirt!

  • @nasrmgk
    @nasrmgk 5 лет назад +1

    Awesome channel with useful informations

  • @solderon
    @solderon 5 лет назад +1

    it 'll be great if you try to explain more each transition part in the video (not talking about thus one)
    btw you're my preferred angular channel on RUclips.
    and don't forget to send me da t-shirt :p

  • @adriandinca5682
    @adriandinca5682 5 лет назад

    Thank so much for mentioning that quicklink library

  • @themindstorm9947
    @themindstorm9947 5 лет назад

    Thanks for all these tutorials!

  • @SurendraSinghChhabra
    @SurendraSinghChhabra 5 лет назад

    Really short and simple video. Thanks !!

  • @didimedina4858
    @didimedina4858 5 лет назад

    Wow this is great! Going to spend sometime tinkering with this and animejs this upcoming weekend :)

  • @vaibhav1180
    @vaibhav1180 5 лет назад +1

    Now it's supported in both Safari and iOS Safari, Cheers!

  • @ashwinshenoy6360
    @ashwinshenoy6360 5 лет назад

    Your firebase related stuff is really good.

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

    you are amazing , i would love a full project from you hopefully

  • @SoundFilmDesign
    @SoundFilmDesign 5 лет назад

    Awesome video.. and awesome shirt!

  • @AungBaw
    @AungBaw 5 лет назад

    Super crisp quality 🔥 fireship shirt yes!

  • @giangonzaga4900
    @giangonzaga4900 5 лет назад

    Wonderful thumbnail!

  • @FauzulChowdhury
    @FauzulChowdhury 5 лет назад +1

    Hi Jeff, I have learnt so much from you and about angular and firebase. I was hoping if you could find your time to make a video on angular search engine crawlabilty and server side rendering technique? This would really boost my confidence. Thank you.

  • @ikezedev
    @ikezedev 5 лет назад +2

    Liked before I watched it.... And when I did watch it, I wanted to love it but RUclips hasn't got any love button.... 😍

    • @Fireship
      @Fireship  5 лет назад +1

      WINNER! Congrats, direct message me with your address and shirt size :)

    • @ikezedev
      @ikezedev 5 лет назад

      @@Fireship Thanks boss 😍
      Name: Eze Kingsley Ikechukwu
      Address: Department of Geology,
      University of Nigeria Nsukka (UNN),
      P.O. Box 3236, Nsukka 410001,
      Enugu State, NIGERIA.
      Shirt size: XXL

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

    UPDATE:
    you can lazy-load an img by adding loading='lazy' attribute
    ```
    ```

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

      Came across this old video as part of a playlist and yeah, this comment should probably be pinned

  • @Shashank.Shinde
    @Shashank.Shinde 5 лет назад +1

    I learned a lot firebase stuff from you

  • @harshitjoshi3082
    @harshitjoshi3082 5 лет назад

    The t shirt looks good !

  • @srukshan98
    @srukshan98 5 лет назад

    This is awesome! Didn't know that it is that easy... Thank you for this amazing video

  • @firaskudsy
    @firaskudsy 5 лет назад +1

    U keep posting amazing videos.. 🙌

  • @polinistinga1
    @polinistinga1 5 лет назад

    Awesome work!

  • @brahim_boussadjra
    @brahim_boussadjra 5 лет назад

    however i'm Vue js developer but i love your videos since they're of high quality

  • @shivisuper
    @shivisuper 5 лет назад

    This is really cool! Thanks for a very nice explanation

  • @jijinp1612
    @jijinp1612 5 лет назад

    Short and Useful stuff. Thank A lot

  • @johnjoseph8294
    @johnjoseph8294 5 лет назад

    Once again great tutorial. Hat off to you men!

  • @scottmccartney1518
    @scottmccartney1518 5 лет назад

    Great video, been looking to implement Angular Material's scrolling soon!

  • @sourishdutta9600
    @sourishdutta9600 5 лет назад

    This one is amazing!! Thanks man!! Can you please make one video that how we can preserve the scroll position of a page. Like in medium app it redirects us to that perticular position where we stop reading one article and very smooth transition was there how to achieve this in js and angular. Thanks a lot. You are awesome. Will be waiting for more.

  • @danielsimionescu298
    @danielsimionescu298 5 лет назад

    Thank you so much! Exactly what I was looking for 😄

  • @The-Average-Gamer
    @The-Average-Gamer 5 лет назад

    Awesome topic, please do more

  • @antlemec
    @antlemec 5 лет назад

    finally understood what lazy loading is ...

  • @divanvanbiljon7603
    @divanvanbiljon7603 5 лет назад

    Awesome shirt!

  • @julianvogel499
    @julianvogel499 5 лет назад +1

    Great Tutorial, learned a lot thanks=) But what about Background images? Is it possible to do it the same way with url? I mean, if I'm using a div for example and the Background Image is as an style element in it.... would that work?

  • @vysanthskurup4374
    @vysanthskurup4374 5 лет назад

    Excellent explanation 👍

  • @satajyotidhawa4937
    @satajyotidhawa4937 5 лет назад

    Awsome video.its helps me to learn this new thing

  • @karsongrady
    @karsongrady 5 лет назад

    Thank you! Great video. I like the vanilla javascript videos

    • @Fireship
      @Fireship  5 лет назад

      Thank you, I'll be making one of these every couple weeks.

  • @elmotareal
    @elmotareal 5 лет назад

    Damn! Man! This was a "mic drop" quality video :)

  • @natanfourie
    @natanfourie 5 лет назад

    Nice to know this trick 🙂👌

  • @balajkhan9894
    @balajkhan9894 5 лет назад

    Love your content to the point 👍

  • @AmanNidhi
    @AmanNidhi 5 лет назад

    this are useful videos. thanks for creating it. Can you also create a playlist so that the videos are easily available and sequential order. This playlist might help help in understanding the nuance of javascript and web development

    • @Fireship
      @Fireship  5 лет назад

      Thank you, yes I'll do that now that there are a few of them.

  • @amritgupta1792
    @amritgupta1792 5 лет назад

    You guys are awesome

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

    The video was very useful for me. thanks

  • @peoplethesedaysberetarded
    @peoplethesedaysberetarded 5 лет назад

    Hmm. It’s clear that I’ll have to look and see if I can roll this into GatsbyJS. I’ve got a small upcoming project that’s image-heavy (30+ images, SPA, SSR for analytics, content editing by the client via headless CMS).

    • @Fireship
      @Fireship  5 лет назад

      FYI there are also packages that do all the work for you www.npmjs.com/package/vanilla-lazyload

  • @nickstrands
    @nickstrands 5 лет назад

    This is so useful to me right now !

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

    Great video!

  • @carlosalfredo657
    @carlosalfredo657 5 лет назад

    Excellent

  • @ezeeok
    @ezeeok 5 лет назад

    Love this series!

  • @emerald42481
    @emerald42481 3 месяца назад

    Wow back in the day before the rebrand

  • @dwscheng
    @dwscheng 5 лет назад

    Great content!!!

  • @giancarlosisasi4137
    @giancarlosisasi4137 5 лет назад

    Awesome video, thanks a lot!

  • @monsieurBoutte
    @monsieurBoutte 5 лет назад

    Beautiful

  • @just0for0adult
    @just0for0adult 5 лет назад

    Thanks for the knowledge shared

  • @25isfunnierthan24
    @25isfunnierthan24 5 лет назад

    Wow that's awesome! Didn't know that even existed

  • @devangrojasara9080
    @devangrojasara9080 5 лет назад

    Awesome Videos

  • @joedyer1989
    @joedyer1989 5 лет назад

    Awesome tut! I just wondered what the difference between/what's best to use - the unobserve or the disconnect method?

  • @mendisterenfeld2668
    @mendisterenfeld2668 5 лет назад

    Great video.

  • @divinedela9125
    @divinedela9125 5 лет назад

    Tnx Jeff.. great video as always

  • @furkanacar
    @furkanacar 5 лет назад

    Is it worth to manipulate the app beforehand and act upon user-agent support? I mean If I am to use any API that is not widely supported on mobile browsers, is it worth to write a fallback version of my-cool-components? Thanks!

  • @jensbienias1157
    @jensbienias1157 5 лет назад

    This is so helpful. Thanks a lot!

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

    why not just set the attribute "loading" of your img?
    is even more efficient, isn't it?

    • @thomasjoli-coeur6037
      @thomasjoli-coeur6037 2 года назад

      «For most websites, adding this attribute to inline images will be a performance boost and save users loading images that they may not ever scroll to. If you have large numbers of images and want to be sure that users of browsers without support for lazy-loading benefit you[...]» Safari uses to not support this feature and now does on version 15.4 and +

  • @chellappanv2281
    @chellappanv2281 5 лет назад

    Thanks for the great video!!!

  • @DridgeDEU
    @DridgeDEU 5 лет назад

    I am usually a quiet observer but now gladly comment for having the chance to win such a nice T-Shirt!

  • @BytesAndBrackets
    @BytesAndBrackets 5 лет назад

    Amazing.. never knew it before

  • @rithinprakash5045
    @rithinprakash5045 5 лет назад

    Always sharp

  • @elliotheath5366
    @elliotheath5366 5 лет назад

    Good stuff, Jeff!

  • @ZachInSpace
    @ZachInSpace 5 лет назад

    Love it, thank you!

  • @anymeshsingh
    @anymeshsingh 5 лет назад +1

    Can you make a video on how to lazy-load images from firestore in an angular app through renderer service and not through DOM so that it can be used with angular universal?