I want to disable the vertical movement of the webpage during the scroll down action and simply trigger an animation for it.
Also I wanto make sure that this is getting disabled only after passing some specified vertical position. These are the 2 sections in my page.
<section id="3" class="window">
<div class="content">
<button id="slide">slide</button>
<img height="700" src="/home/varun/Documents/Crown/images/line.png" id="2guns" style="position:relative; left:1293px; bottom: 50px;">
</div>
</section>
<section id="4" class="window">
<div class="content">
</div>
</section>
And this is the Jquery I have given to the sectio:id:3
$(window).scroll(function() {
var y_scroll_pos = window.pageYOffset;
var scroll_pos_test =2000;
if(y_scroll_pos > scroll_pos_test) {
$('#2guns'&&'#3').animate({left: -14600},7000);
}
});
Here,the section:id:3 starts at 2000px.
Now the question is, on scrolling down past the 2000, I want to disable the vertical displacement of the page.