IntersectionObserver: Trigger event when scrolling back to the top The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceGetting the ID of the element that fired an eventWhen are you supposed to use escape instead of encodeURI / encodeURIComponent?Scroll to the top of the page using JavaScript/jQuery?How to trigger event in JavaScript?Make the cursor a hand when a user hovers over a list itemCheck if a user has scrolled to the bottomjQuery scroll to elementSmooth scrolling when clicking an anchor linkPrevent BODY from scrolling when a modal is openedChanging route doesn't scroll to top in the new page

Mortgage adviser recommends a longer term than necessary combined with overpayments

How to support a colleague who finds meetings extremely tiring?

Student Loan from years ago pops up and is taking my salary

Button changing its text & action. Good or terrible?

Is this wall load bearing? Blueprints and photos attached

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?

My body leaves; my core can stay

Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point?

Can the Right Ascension and Argument of Perigee of a spacecraft's orbit keep varying by themselves with time?

Is there a writing software that you can sort scenes like slides in PowerPoint?

US Healthcare consultation for visitors

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

University's motivation for having tenure-track positions

How did the audience guess the pentatonic scale in Bobby McFerrin's presentation?

For what reasons would an animal species NOT cross a *horizontal* land bridge?

What's the point in a preamp?

Does Parliament need to approve the new Brexit delay to 31 October 2019?

Why doesn't a hydraulic lever violate conservation of energy?

Why are there uneven bright areas in this photo of black hole?

Homework question about an engine pulling a train

How to determine omitted units in a publication

Why can't devices on different VLANs, but on the same subnet, communicate?

Sub-subscripts in strings cause different spacings than subscripts

One-dimensional Japanese puzzle



IntersectionObserver: Trigger event when scrolling back to the top



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceGetting the ID of the element that fired an eventWhen are you supposed to use escape instead of encodeURI / encodeURIComponent?Scroll to the top of the page using JavaScript/jQuery?How to trigger event in JavaScript?Make the cursor a hand when a user hovers over a list itemCheck if a user has scrolled to the bottomjQuery scroll to elementSmooth scrolling when clicking an anchor linkPrevent BODY from scrolling when a modal is openedChanging route doesn't scroll to top in the new page



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am starting to use the IntersectionObserver API and could create some basic animations, which includes hiding and appearing of elements. However, once a person wants to scroll back to the top, the elements which disappeared by one of the triggers are not getting visible again.



My Solution so far



So I thought I might create another test variable within the intersection observer callback function (the stepI and stepII variable in my code), which checks if the callback function was previously triggered. If so, instead of disappearing the elements, let them appear again.



My current problem



So let's say a background image (id="hiddenImg") should appear when the first text block (id="I") passes the 50% border of the viewport and it disappears when the second text block (id="II") enters this area. Even though the image is getting visible again when scrolling back up, if the user does not scroll back completely (so that the second text block goes out of the viewport) and then scrolls back to the bottom, the disappearing trigger of that second text block is not called. This would mean that the background image would stay visible, which it shouldn't.



Here is the js part:



var stepI = false;
var stepII = false;

// list of options
let options =
rootMargin: '0px 0px -50%' //WHEN reaching half of the viewport
;

// instantiate a new Intersection Observer
"use strict";

var intersectionObserver = new IntersectionObserver(function (entries, observer)
entries.forEach(function (change)
if (change.isIntersecting)
if (change.target.id == "I")
$("#hiddenImg").removeClass("hidden_img");
$("#hiddenImg").addClass("visible_img");

stepI = true;

observer.unobserve(change.target);



if (change.target.id == "II")
if (stepII == false)
$("#hiddenImg").removeClass("visible_map");
$("#hiddenImg").addClass("hidden_map");

stepII = true

else
$("#hiddenImg").removeClass("hidden_map");
$("#hiddenImg").addClass("visible_map");

stepII = false;



);
,options);

// list of paragraphs
let elements = document.querySelectorAll(".stepper");

for (let elm of elements)
intersectionObserver.observe(elm);



Here is my complete code:



<html>
<head>
<!-- Load the polyfill. -->
<script src="/js/intersection-observer.js"></script>

<script src='https://unpkg.com/intersection-observer@0.5.0/intersection-observer.js'></script>

</head>
<body>
<style>
.intro-imgs
display: block;
margin: 0 auto; /* Will not center vertically and won't work in IE6/7. */
left: 0;
right: 0;
position: fixed;
position: expression(fixed);


.hidden_img
visibility: hidden;
opacity: 0;
-ms-transform: scaleX(0); /* IE 9 */
-webkit-transform: scaleX(0); /* Safari 3-8 */
-o-transform: scaleX(0);
-moz-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: visibility 0s 0.5s, opacity 0.5s linear, -webkit-transform 0.5s;
-moz-transition: visibility 0s 0.5s, opacity 0.5s linear, -moz-transform 0.5s;
-o-transition: visibility 0s 0.5s, opacity 0.5s linear, -o-transform 0.5s;
transition: visibility 0s 0.5s, opacity 0.5s linear, transform 0.5s;


.visible_img
visibility: visible;
opacity: 1;
-ms-transform: scaleX(1); /* IE 9 */
-webkit-transform: scaleX(1); /* Safari 3-8 */
-o-transform: scaleX(1);
-moz-transform: scaleX(1);
transform: scaleX(1);
-webkit-transition: opacity 0.5s linear, -webkit-transform 0.5s;
-moz-transition: opacity 0.5s linear, -moz-transform 0.5s;
-o-transition: opacity 0.5s linear, -o-transform 0.5s;
transition: opacity 0.5s linear, transform 0.5s;


.stepper
max-width: 70rem;
margin: 550px auto 600px auto;
width: 90%;
background-color: rgba(248, 248, 248, 0.95);
font-family: "Helvetica";
font-size: 17px;
line-height: 26px;
padding: 15px;

</style>

<!--HTML-->
<div class="headline">
<img id="hiddenImg" class="hidden_img intro-imgs" src="https://image.shutterstock.com/image-photo/funny-portrait-hero-260nw-410898763.jpg" >
</div>
<div id="I" class="stepper">
<p>Lorem Ipsum</p>
</div>
<div id="II" class="stepper">
<h1>THE HEADLINE</h1>
</div>

<!-- SCRIPT-->
<script>
var stepI = false;
var stepII = false;

// list of options
let options =
rootMargin: '0px 0px -50%' //WHEN reaching half of the viewport
;

// instantiate a new Intersection Observer
"use strict";

var intersectionObserver = new IntersectionObserver(function (entries, observer)
entries.forEach(function (change)
if (change.isIntersecting)
if (change.target.id == "I")
$("#hiddenImg").removeClass("hidden_img");
$("#hiddenImg").addClass("visible_img");

stepI = true;

observer.unobserve(change.target);



if (change.target.id == "II")
if (stepII == false)
$("#hiddenImg").removeClass("visible_map");
$("#hiddenImg").addClass("hidden_map");

stepII = true

else
$("#hiddenImg").removeClass("hidden_map");
$("#hiddenImg").addClass("visible_map");

stepII = false;



);
,options);

// list of paragraphs
let elements = document.querySelectorAll(".stepper");

for (let elm of elements)
intersectionObserver.observe(elm);

</script>
</body>









share|improve this question




























    0















    I am starting to use the IntersectionObserver API and could create some basic animations, which includes hiding and appearing of elements. However, once a person wants to scroll back to the top, the elements which disappeared by one of the triggers are not getting visible again.



    My Solution so far



    So I thought I might create another test variable within the intersection observer callback function (the stepI and stepII variable in my code), which checks if the callback function was previously triggered. If so, instead of disappearing the elements, let them appear again.



    My current problem



    So let's say a background image (id="hiddenImg") should appear when the first text block (id="I") passes the 50% border of the viewport and it disappears when the second text block (id="II") enters this area. Even though the image is getting visible again when scrolling back up, if the user does not scroll back completely (so that the second text block goes out of the viewport) and then scrolls back to the bottom, the disappearing trigger of that second text block is not called. This would mean that the background image would stay visible, which it shouldn't.



    Here is the js part:



    var stepI = false;
    var stepII = false;

    // list of options
    let options =
    rootMargin: '0px 0px -50%' //WHEN reaching half of the viewport
    ;

    // instantiate a new Intersection Observer
    "use strict";

    var intersectionObserver = new IntersectionObserver(function (entries, observer)
    entries.forEach(function (change)
    if (change.isIntersecting)
    if (change.target.id == "I")
    $("#hiddenImg").removeClass("hidden_img");
    $("#hiddenImg").addClass("visible_img");

    stepI = true;

    observer.unobserve(change.target);



    if (change.target.id == "II")
    if (stepII == false)
    $("#hiddenImg").removeClass("visible_map");
    $("#hiddenImg").addClass("hidden_map");

    stepII = true

    else
    $("#hiddenImg").removeClass("hidden_map");
    $("#hiddenImg").addClass("visible_map");

    stepII = false;



    );
    ,options);

    // list of paragraphs
    let elements = document.querySelectorAll(".stepper");

    for (let elm of elements)
    intersectionObserver.observe(elm);



    Here is my complete code:



    <html>
    <head>
    <!-- Load the polyfill. -->
    <script src="/js/intersection-observer.js"></script>

    <script src='https://unpkg.com/intersection-observer@0.5.0/intersection-observer.js'></script>

    </head>
    <body>
    <style>
    .intro-imgs
    display: block;
    margin: 0 auto; /* Will not center vertically and won't work in IE6/7. */
    left: 0;
    right: 0;
    position: fixed;
    position: expression(fixed);


    .hidden_img
    visibility: hidden;
    opacity: 0;
    -ms-transform: scaleX(0); /* IE 9 */
    -webkit-transform: scaleX(0); /* Safari 3-8 */
    -o-transform: scaleX(0);
    -moz-transform: scaleX(0);
    transform: scaleX(0);
    -webkit-transition: visibility 0s 0.5s, opacity 0.5s linear, -webkit-transform 0.5s;
    -moz-transition: visibility 0s 0.5s, opacity 0.5s linear, -moz-transform 0.5s;
    -o-transition: visibility 0s 0.5s, opacity 0.5s linear, -o-transform 0.5s;
    transition: visibility 0s 0.5s, opacity 0.5s linear, transform 0.5s;


    .visible_img
    visibility: visible;
    opacity: 1;
    -ms-transform: scaleX(1); /* IE 9 */
    -webkit-transform: scaleX(1); /* Safari 3-8 */
    -o-transform: scaleX(1);
    -moz-transform: scaleX(1);
    transform: scaleX(1);
    -webkit-transition: opacity 0.5s linear, -webkit-transform 0.5s;
    -moz-transition: opacity 0.5s linear, -moz-transform 0.5s;
    -o-transition: opacity 0.5s linear, -o-transform 0.5s;
    transition: opacity 0.5s linear, transform 0.5s;


    .stepper
    max-width: 70rem;
    margin: 550px auto 600px auto;
    width: 90%;
    background-color: rgba(248, 248, 248, 0.95);
    font-family: "Helvetica";
    font-size: 17px;
    line-height: 26px;
    padding: 15px;

    </style>

    <!--HTML-->
    <div class="headline">
    <img id="hiddenImg" class="hidden_img intro-imgs" src="https://image.shutterstock.com/image-photo/funny-portrait-hero-260nw-410898763.jpg" >
    </div>
    <div id="I" class="stepper">
    <p>Lorem Ipsum</p>
    </div>
    <div id="II" class="stepper">
    <h1>THE HEADLINE</h1>
    </div>

    <!-- SCRIPT-->
    <script>
    var stepI = false;
    var stepII = false;

    // list of options
    let options =
    rootMargin: '0px 0px -50%' //WHEN reaching half of the viewport
    ;

    // instantiate a new Intersection Observer
    "use strict";

    var intersectionObserver = new IntersectionObserver(function (entries, observer)
    entries.forEach(function (change)
    if (change.isIntersecting)
    if (change.target.id == "I")
    $("#hiddenImg").removeClass("hidden_img");
    $("#hiddenImg").addClass("visible_img");

    stepI = true;

    observer.unobserve(change.target);



    if (change.target.id == "II")
    if (stepII == false)
    $("#hiddenImg").removeClass("visible_map");
    $("#hiddenImg").addClass("hidden_map");

    stepII = true

    else
    $("#hiddenImg").removeClass("hidden_map");
    $("#hiddenImg").addClass("visible_map");

    stepII = false;



    );
    ,options);

    // list of paragraphs
    let elements = document.querySelectorAll(".stepper");

    for (let elm of elements)
    intersectionObserver.observe(elm);

    </script>
    </body>









    share|improve this question
























      0












      0








      0








      I am starting to use the IntersectionObserver API and could create some basic animations, which includes hiding and appearing of elements. However, once a person wants to scroll back to the top, the elements which disappeared by one of the triggers are not getting visible again.



      My Solution so far



      So I thought I might create another test variable within the intersection observer callback function (the stepI and stepII variable in my code), which checks if the callback function was previously triggered. If so, instead of disappearing the elements, let them appear again.



      My current problem



      So let's say a background image (id="hiddenImg") should appear when the first text block (id="I") passes the 50% border of the viewport and it disappears when the second text block (id="II") enters this area. Even though the image is getting visible again when scrolling back up, if the user does not scroll back completely (so that the second text block goes out of the viewport) and then scrolls back to the bottom, the disappearing trigger of that second text block is not called. This would mean that the background image would stay visible, which it shouldn't.



      Here is the js part:



      var stepI = false;
      var stepII = false;

      // list of options
      let options =
      rootMargin: '0px 0px -50%' //WHEN reaching half of the viewport
      ;

      // instantiate a new Intersection Observer
      "use strict";

      var intersectionObserver = new IntersectionObserver(function (entries, observer)
      entries.forEach(function (change)
      if (change.isIntersecting)
      if (change.target.id == "I")
      $("#hiddenImg").removeClass("hidden_img");
      $("#hiddenImg").addClass("visible_img");

      stepI = true;

      observer.unobserve(change.target);



      if (change.target.id == "II")
      if (stepII == false)
      $("#hiddenImg").removeClass("visible_map");
      $("#hiddenImg").addClass("hidden_map");

      stepII = true

      else
      $("#hiddenImg").removeClass("hidden_map");
      $("#hiddenImg").addClass("visible_map");

      stepII = false;



      );
      ,options);

      // list of paragraphs
      let elements = document.querySelectorAll(".stepper");

      for (let elm of elements)
      intersectionObserver.observe(elm);



      Here is my complete code:



      <html>
      <head>
      <!-- Load the polyfill. -->
      <script src="/js/intersection-observer.js"></script>

      <script src='https://unpkg.com/intersection-observer@0.5.0/intersection-observer.js'></script>

      </head>
      <body>
      <style>
      .intro-imgs
      display: block;
      margin: 0 auto; /* Will not center vertically and won't work in IE6/7. */
      left: 0;
      right: 0;
      position: fixed;
      position: expression(fixed);


      .hidden_img
      visibility: hidden;
      opacity: 0;
      -ms-transform: scaleX(0); /* IE 9 */
      -webkit-transform: scaleX(0); /* Safari 3-8 */
      -o-transform: scaleX(0);
      -moz-transform: scaleX(0);
      transform: scaleX(0);
      -webkit-transition: visibility 0s 0.5s, opacity 0.5s linear, -webkit-transform 0.5s;
      -moz-transition: visibility 0s 0.5s, opacity 0.5s linear, -moz-transform 0.5s;
      -o-transition: visibility 0s 0.5s, opacity 0.5s linear, -o-transform 0.5s;
      transition: visibility 0s 0.5s, opacity 0.5s linear, transform 0.5s;


      .visible_img
      visibility: visible;
      opacity: 1;
      -ms-transform: scaleX(1); /* IE 9 */
      -webkit-transform: scaleX(1); /* Safari 3-8 */
      -o-transform: scaleX(1);
      -moz-transform: scaleX(1);
      transform: scaleX(1);
      -webkit-transition: opacity 0.5s linear, -webkit-transform 0.5s;
      -moz-transition: opacity 0.5s linear, -moz-transform 0.5s;
      -o-transition: opacity 0.5s linear, -o-transform 0.5s;
      transition: opacity 0.5s linear, transform 0.5s;


      .stepper
      max-width: 70rem;
      margin: 550px auto 600px auto;
      width: 90%;
      background-color: rgba(248, 248, 248, 0.95);
      font-family: "Helvetica";
      font-size: 17px;
      line-height: 26px;
      padding: 15px;

      </style>

      <!--HTML-->
      <div class="headline">
      <img id="hiddenImg" class="hidden_img intro-imgs" src="https://image.shutterstock.com/image-photo/funny-portrait-hero-260nw-410898763.jpg" >
      </div>
      <div id="I" class="stepper">
      <p>Lorem Ipsum</p>
      </div>
      <div id="II" class="stepper">
      <h1>THE HEADLINE</h1>
      </div>

      <!-- SCRIPT-->
      <script>
      var stepI = false;
      var stepII = false;

      // list of options
      let options =
      rootMargin: '0px 0px -50%' //WHEN reaching half of the viewport
      ;

      // instantiate a new Intersection Observer
      "use strict";

      var intersectionObserver = new IntersectionObserver(function (entries, observer)
      entries.forEach(function (change)
      if (change.isIntersecting)
      if (change.target.id == "I")
      $("#hiddenImg").removeClass("hidden_img");
      $("#hiddenImg").addClass("visible_img");

      stepI = true;

      observer.unobserve(change.target);



      if (change.target.id == "II")
      if (stepII == false)
      $("#hiddenImg").removeClass("visible_map");
      $("#hiddenImg").addClass("hidden_map");

      stepII = true

      else
      $("#hiddenImg").removeClass("hidden_map");
      $("#hiddenImg").addClass("visible_map");

      stepII = false;



      );
      ,options);

      // list of paragraphs
      let elements = document.querySelectorAll(".stepper");

      for (let elm of elements)
      intersectionObserver.observe(elm);

      </script>
      </body>









      share|improve this question














      I am starting to use the IntersectionObserver API and could create some basic animations, which includes hiding and appearing of elements. However, once a person wants to scroll back to the top, the elements which disappeared by one of the triggers are not getting visible again.



      My Solution so far



      So I thought I might create another test variable within the intersection observer callback function (the stepI and stepII variable in my code), which checks if the callback function was previously triggered. If so, instead of disappearing the elements, let them appear again.



      My current problem



      So let's say a background image (id="hiddenImg") should appear when the first text block (id="I") passes the 50% border of the viewport and it disappears when the second text block (id="II") enters this area. Even though the image is getting visible again when scrolling back up, if the user does not scroll back completely (so that the second text block goes out of the viewport) and then scrolls back to the bottom, the disappearing trigger of that second text block is not called. This would mean that the background image would stay visible, which it shouldn't.



      Here is the js part:



      var stepI = false;
      var stepII = false;

      // list of options
      let options =
      rootMargin: '0px 0px -50%' //WHEN reaching half of the viewport
      ;

      // instantiate a new Intersection Observer
      "use strict";

      var intersectionObserver = new IntersectionObserver(function (entries, observer)
      entries.forEach(function (change)
      if (change.isIntersecting)
      if (change.target.id == "I")
      $("#hiddenImg").removeClass("hidden_img");
      $("#hiddenImg").addClass("visible_img");

      stepI = true;

      observer.unobserve(change.target);



      if (change.target.id == "II")
      if (stepII == false)
      $("#hiddenImg").removeClass("visible_map");
      $("#hiddenImg").addClass("hidden_map");

      stepII = true

      else
      $("#hiddenImg").removeClass("hidden_map");
      $("#hiddenImg").addClass("visible_map");

      stepII = false;



      );
      ,options);

      // list of paragraphs
      let elements = document.querySelectorAll(".stepper");

      for (let elm of elements)
      intersectionObserver.observe(elm);



      Here is my complete code:



      <html>
      <head>
      <!-- Load the polyfill. -->
      <script src="/js/intersection-observer.js"></script>

      <script src='https://unpkg.com/intersection-observer@0.5.0/intersection-observer.js'></script>

      </head>
      <body>
      <style>
      .intro-imgs
      display: block;
      margin: 0 auto; /* Will not center vertically and won't work in IE6/7. */
      left: 0;
      right: 0;
      position: fixed;
      position: expression(fixed);


      .hidden_img
      visibility: hidden;
      opacity: 0;
      -ms-transform: scaleX(0); /* IE 9 */
      -webkit-transform: scaleX(0); /* Safari 3-8 */
      -o-transform: scaleX(0);
      -moz-transform: scaleX(0);
      transform: scaleX(0);
      -webkit-transition: visibility 0s 0.5s, opacity 0.5s linear, -webkit-transform 0.5s;
      -moz-transition: visibility 0s 0.5s, opacity 0.5s linear, -moz-transform 0.5s;
      -o-transition: visibility 0s 0.5s, opacity 0.5s linear, -o-transform 0.5s;
      transition: visibility 0s 0.5s, opacity 0.5s linear, transform 0.5s;


      .visible_img
      visibility: visible;
      opacity: 1;
      -ms-transform: scaleX(1); /* IE 9 */
      -webkit-transform: scaleX(1); /* Safari 3-8 */
      -o-transform: scaleX(1);
      -moz-transform: scaleX(1);
      transform: scaleX(1);
      -webkit-transition: opacity 0.5s linear, -webkit-transform 0.5s;
      -moz-transition: opacity 0.5s linear, -moz-transform 0.5s;
      -o-transition: opacity 0.5s linear, -o-transform 0.5s;
      transition: opacity 0.5s linear, transform 0.5s;


      .stepper
      max-width: 70rem;
      margin: 550px auto 600px auto;
      width: 90%;
      background-color: rgba(248, 248, 248, 0.95);
      font-family: "Helvetica";
      font-size: 17px;
      line-height: 26px;
      padding: 15px;

      </style>

      <!--HTML-->
      <div class="headline">
      <img id="hiddenImg" class="hidden_img intro-imgs" src="https://image.shutterstock.com/image-photo/funny-portrait-hero-260nw-410898763.jpg" >
      </div>
      <div id="I" class="stepper">
      <p>Lorem Ipsum</p>
      </div>
      <div id="II" class="stepper">
      <h1>THE HEADLINE</h1>
      </div>

      <!-- SCRIPT-->
      <script>
      var stepI = false;
      var stepII = false;

      // list of options
      let options =
      rootMargin: '0px 0px -50%' //WHEN reaching half of the viewport
      ;

      // instantiate a new Intersection Observer
      "use strict";

      var intersectionObserver = new IntersectionObserver(function (entries, observer)
      entries.forEach(function (change)
      if (change.isIntersecting)
      if (change.target.id == "I")
      $("#hiddenImg").removeClass("hidden_img");
      $("#hiddenImg").addClass("visible_img");

      stepI = true;

      observer.unobserve(change.target);



      if (change.target.id == "II")
      if (stepII == false)
      $("#hiddenImg").removeClass("visible_map");
      $("#hiddenImg").addClass("hidden_map");

      stepII = true

      else
      $("#hiddenImg").removeClass("hidden_map");
      $("#hiddenImg").addClass("visible_map");

      stepII = false;



      );
      ,options);

      // list of paragraphs
      let elements = document.querySelectorAll(".stepper");

      for (let elm of elements)
      intersectionObserver.observe(elm);

      </script>
      </body>






      javascript css scroll intersection-observer






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 22 at 6:04









      JoeBeJoeBe

      459




      459






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55293778%2fintersectionobserver-trigger-event-when-scrolling-back-to-the-top%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55293778%2fintersectionobserver-trigger-event-when-scrolling-back-to-the-top%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript