How do I go by adding .animate to this piece of code?
$("body,html").scrollTop($("#wrapper3").position().top);
I have tried adding .animate
before scrollTop
, but it keeps showing an error in Dreamweaver.
Any help is appreciated.
EDIT:
HTML
<!DOCTYPE html>
<meta charset=utf-8>
<html lang="da">
<html>
<head>
<link href="_css/fddkStyles.css" rel="stylesheet" type="text/css" />
<link href="jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css" />
<script src="_jquery/jquery-1.10.1.min.js"></script>
<title>Title of the document</title>
</head>
<body>
<div id="wrapper">
<div id="bar16"></div>
</div>
<div id="wrapper2">
</div>
<div id="wrapper3">
</div>
<script src="_jquery/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="_jquery/TweenMax.min.js"></script>
<script src="_jquery/my.js" type="text/javascript"></script>
<script src="_jquery/jquery.scrollTo-1.4.3.1-min.js"></script>
</body>
</html>
JavaScript
$(document).ready(function(e) {
$("#bar16").click(function() {
$("body,html").scrollTop($("#wrapper3").position().top);
});
});