I've tried to use a jQuery plugin within viewport to detect whether or not an element is in the viewport.
It works, but it doesn't update.
He recommandes ScrollStop. I add it, but it doesn't work.
I only put my code here:
$(document).ready(function() {
$(window).bind("resize scrollStop", function() {
$("div").withinViewport().append("<span>hi</span>");
});
});
(plus, it's using the bind method, so it's a bit outdated..)
So, it may be simple, but I didn't get it to work.
I'm new to jQuery and javascript so.. It may be super simple.
Here's the website with the code and everything
edit: works on resize ! but not on scroll.