Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make sure it also works in scrolling parents #4

Merged
merged 1 commit into from

2 participants

@fhackenberger

Until this patch the appear plugin did not fire any events in the following scenario:

<body>
<div>
  ....
  <div style="overflow-y: scroll">
    .....
    <div class="appear-marker"></div>
  </div>
  ....
</div>
</body>
fhackenberger Make sure it also works in scrolling parents
Until this patch the appear plugin did not fire any events in the following scenario:

<body>
<div>
  ....
  <div style="overflow-y: scroll">
    .....
    <div class="appear-marker"></div>
  </div>
  ....
</div>
</body>
0940aef
@morr morr merged commit 075573a into morr:master
@morr

@fhackenberger hi!
I reverted this changes. Unfortunately they are not working as expected. Please check this demo page http://morr.github.com/appear.scroll.html and try to scroll overflowed div.
Overflowed elements became "appeared" even when they are not visible. It is not enough just to add additional event handler for overflow=scroll containers, you have to consider this situation in "process" function. Unfortunately it is not very efficient and it is rather complicated check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 31, 2013
  1. Make sure it also works in scrolling parents

    fhackenberger authored
    Until this patch the appear plugin did not fire any events in the following scenario:
    
    <body>
    <div>
      ....
      <div style="overflow-y: scroll">
        .....
        <div class="appear-marker"></div>
      </div>
      ....
    </div>
    </body>
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 jquery.appear.js
View
5 jquery.appear.js
@@ -73,6 +73,11 @@
};
$(window).scroll(on_check).resize(on_check);
+ this.parents().each(function() {
+ $this = $(this);
+ if($this.css('overflow') == 'scroll' || $this.css('overflow-x') == 'scroll' || $this.css('overflow-y') == 'scroll')
+ $this.scroll(on_check).resize(on_check);
+ });
check_binded = true;
}
Something went wrong with that request. Please try again.