I've been trying to set up a simple click to continue to next , but I've been running into an issue with the script. The $ before "button" is undefined on my site. How could I make it not undefined?
HTML:
<div class="first">
<button type="button">Click to continue downwards</button>
</div>
<div class="next">
<button type="button">Click to continue downwards</button>
test
</div>
<div class="next">
<button type="button">Click to continue downwards</button>
test
</div>
CSS:
.first {
width: 100%;
height: 1000px;
background: #ccc;
}
.next {
width: 100%;
height: 1000px;
background: #999;
overflow: scroll;
}
JScript:
<script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript">
$("button").click(function() {
$('html,body').animate({
scrollTop: $(this).parent().next().offset().top},
'slow');
});
</script>