Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

above-the-top is reporting same results as :in-viewport #6

Open
SeanGriffin opened this issue Dec 11, 2012 · 0 comments
Open

above-the-top is reporting same results as :in-viewport #6

SeanGriffin opened this issue Dec 11, 2012 · 0 comments

Comments

@SeanGriffin
Copy link

I have a page with three dom elements spread from top to bottom, none are visible on page load. Once element 1 enters into the viewport, both :in-viewport and :above-the-top report that element as one of theirs.

$(window).bind('scroll', function(event){
var videoInView = $('video:in-viewport').attr('id');
console.log('IN VIEWPORT = ' + videoInView);
var videoAboveTop = $('video:above-the-top').attr('id');
console.log('ABOVE THE TOP = ' + videoAboveTop);
var videoBelowFold = $('video:below-the-fold').attr('id');
console.log('BELOW THE FOLD = ' + videoBelowFold);
});

console shows

IN VIEWPORT = video1
ABOVE THE TOP = video1
BELOW THE FOLD = video2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant