Hi Guys,
I want to add a class on a DIV, when it is visible to user.
It is working by defining scroll to 200 but it may not work if i have more content on top. So please tell me the simplest way to add class when the DIV is actually visible.
Please see this website for reference (animated content) gojavas . com
Code:$(document).scroll(function() { var scroll = $(this).scrollTop(); if (scroll >= 200) { $(".circle").addClass("rect"); } })Code:<div id="space"></div> <div class="circle"></div>
Bookmarks