A very simplified guide on the Intersection Observer API, with examples

Поділитися
Вставка
  • Опубліковано 10 лют 2025
  • While there are many libraries out there for intersection animations, you can also use the INTERSECTION OBSERVER API in JavaScript. This API allows you to observer intersections of elements, and trigger things like transitions, lazy-loading and lots more.
    In this video, I help you understand how this API works, and show you some transition examples.
    Codepen link: codepen.io/Dil...
    Helpful resources:
    Visibility vs Display: • DISPLAY:NONE and VISIB...
    _____
    Subscribe to My Channel: bit.ly/deeecode
    _____
    🌟 About Me:
    Dillion Megida, creator of DEEECODE, is a Software Engineer, Developer Advocate and a Content Creator passionate about simplifying topics around Tech via articles and videos.
    _____
    ⚡️ Connect with me:
    Personal youtube: / dillionmegida
    Personal website: dillionmegida....
    Twitter: / iamdillion
    Instagram: / deeecode
    LinkedIn: / dillionmegida
    GitHub: github.com/dil...

КОМЕНТАРІ • 48

  • @AcademicStars
    @AcademicStars 7 місяців тому +1

    You are a next best Web development commentator. Excellent explanation. I didn't just get a clarity on a Intersection Observer subject, but on other CSS classes. Thanks for your efforts.

  • @Pixelyze-tech
    @Pixelyze-tech 20 днів тому

    I personally appriacte how you explain the code and make it easier to understand the logic behind this.

    • @deeecode
      @deeecode  16 днів тому

      I'm glad to hear this was helpful

  • @gt_n1722
    @gt_n1722 5 місяців тому +1

    This is an excellent video; simple and easy to understand. Thank you!

  • @benficafutbol4651
    @benficafutbol4651 11 місяців тому +1

    Really well explained, I was struggling to understand the options, and you cleared it up really well. Thank you.

  • @TyMayor-p3j
    @TyMayor-p3j 5 місяців тому +1

    So nice to watch. Keep the good work bro

  • @CLeovison
    @CLeovison Рік тому

    Thankyouu so muuuch for early christmas gift, i have been waiting for this. ❤️❤️

    • @deeecode
      @deeecode  Рік тому +1

      I'm so glad to hear. Let me know what you build with this :)

  • @bigshuff
    @bigshuff 8 місяців тому

    Mate that was really good watched it several times now. Thanks

    • @deeecode
      @deeecode  7 місяців тому

      Glad you enjoyed it

  • @uppaarrwala
    @uppaarrwala 3 місяці тому

    Great video man!!!

  • @marializa505
    @marializa505 10 місяців тому

    Excellent information, thank you so much for explaining in a way that's easy to understand! :)

    • @deeecode
      @deeecode  10 місяців тому +1

      I'm so glad to hear

  • @shehnazameer1209
    @shehnazameer1209 4 місяці тому

    that was great help. Thank you

    • @deeecode
      @deeecode  3 місяці тому

      You're welcome!

  • @sabbirahamed7050
    @sabbirahamed7050 3 місяці тому

    That is a very well explanation.

  • @lvekua
    @lvekua Рік тому

    Awesome guide! thank you!

  • @sahilsaiyad-d3j
    @sahilsaiyad-d3j 8 місяців тому

    great job bro , liked it.....

  • @jmdev31584
    @jmdev31584 6 місяців тому

    Great content! Keep it up!

  • @PhucTran-zj5is
    @PhucTran-zj5is 7 місяців тому

    Thanks for your help bro. Keep it up ❤

    • @deeecode
      @deeecode  7 місяців тому

      You're very welcome!

  • @escaparatevisual
    @escaparatevisual Рік тому

    Awesome stuff! Thank you for sharing!

    • @deeecode
      @deeecode  Рік тому +1

      You're very welcome!

  • @BlackPlavy
    @BlackPlavy 9 місяців тому

    Great video, thanks!

    • @deeecode
      @deeecode  8 місяців тому +1

      You’re welcome :)

  • @Sameena-iz7uq
    @Sameena-iz7uq 6 місяців тому

    Well explain. Salute

  • @HelloWorld17th
    @HelloWorld17th Рік тому

    Really awesome video 📸🎉🎉...

  • @fnfal113
    @fnfal113 7 місяців тому

    great vid!

  • @nomeconfundas
    @nomeconfundas 7 місяців тому

    thanks for this great video bro! I would like to check a case with responsive design with lets say some rows with images that in desktop have for example 4 images but in mobile only 2. how would the load behaviour be in both or even more cases like this?

  • @FumezCreates
    @FumezCreates 11 місяців тому

    Excellent Video

    • @deeecode
      @deeecode  11 місяців тому

      Glad you enjoyed it

  • @princeweb1
    @princeweb1 8 місяців тому

    Thank you :)

    • @deeecode
      @deeecode  8 місяців тому

      You're welcome!

  • @LokiDaFerret
    @LokiDaFerret 10 місяців тому

    Hmmmm. Can I specify the root margin in terms of viewport units like VH? It seems like that would be much more practical since 100px is a very small amount on a very big device. Whereas 100px is a very large amount on an old device like an iPhone 3.

  • @cratortech3d472
    @cratortech3d472 Рік тому

    Awesome

  • @PremrajPadakanti
    @PremrajPadakanti Рік тому

    iam surprised how threshold property will access by entries parameter, what is the reason behind it and in callback function another parameter also we can put that is observer like this
    const obsCallback = function (entries, observer) {
    entries.forEach(entry => {
    console.log(entry);
    });
    };
    const obsOptions = {
    root: null,
    threshold: 0.2,
    };
    const observer = new IntersectionObserver(obsCallback, obsOptions);
    observer.observe(section1);
    but another doubt how observer will as parameter ok if it has parameter then how internally thread will execute this code (javaScript runs on single thread only right.....) please explain how thread will execute this
    I researched alot but i never find how this will works internally every article and every vedio explained like this only
    please reply me with answer

  • @marcrodier8652
    @marcrodier8652 5 місяців тому

    wow a hole javascript program without a single semicolon how did you dun miss that.

  • @Sagarclips
    @Sagarclips 8 місяців тому

    Please provide source code

    • @deeecode
      @deeecode  8 місяців тому

      Sorry, I forgot to include it in the video description...here it is: codepen.io/Dillion/pen/abXyZKw

  • @skillradius9867
    @skillradius9867 6 місяців тому

    riyal

  • @colindante5164
    @colindante5164 18 днів тому

    Why is it on page reload entries.length takes into account all entries being observed but as the user scrolls down the page and the callback function gets called, entries.length will always equal to one.? Would anyone care to explain? Thanks

  • @TyMayor-p3j
    @TyMayor-p3j 5 місяців тому

    So nice to watch. Keep the good work bro