I'm currently experimenting with a scroll down button on my website and I'm perplexed as to why it's not functioning properly.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style_sheet.css" type="text/css" rel="stylesheet" />
<title>COS</title>
<script>
$(function() {
$('.scroll-down').click (function() {
$('html, body').animate({scrollTop: $('section.ok').offset().top }, 'slow');
return false;
});
});
</script>
</head>
<body>
<section>
<p>SCROLL DOWN CSS</p>
<a href="#" class="scroll-down" address="true"></a>
</section>
<section class="ok">
<p>OK SCROLL !</p>
</section>
</body>
</html>
From what I gather, the javascript code should be in the head section of the HTML. Can anyone help identify what might be causing this issue?