I have a div on my homepage. I have a .js file which i have to run on it only when the user views it on his screen i.e the div is placed down and the .js file should only be run when the user views the div while scrolling down or up the homepage.
How should i do that?