I want to do something when window scrolls to a certain position
Fiddle : https://jsfiddle.net/to1uuvnb/16/
HTML:
<div id="container"></div>
<div id="target"></div>
CSS:
#container {
min-height:300px;
max-width:400px;
background-color:#000;
}
#target {
min-height:1000px;
max-width:400px;
background-color:red;
}
JavaScript:
$('#target').scroll(function() {
if($(this).scrollTop() > 10) {
alert('');
}
});