47
rated 0 times
[
51]
[
4]
/ answers: 1 / hits: 54829
/ 10 Years ago, wed, june 11, 2014, 12:00:00
I've searched on google the solution to my problem, and I can't understand why the code I've written work for everyone, but not for me.
I've written this:
<head>
<meta charset=utf-8 />
<title></title>
<script type=text/javascript>
function scrollTo() {
$('html, body').animate({ scrollTop: $('#div_id').offset().top }, 'slow');
return false;
}
</script>
<style type=text/css>
.uno {
height: 1000px;
background: #808080;
}
.due {
margin-top: 300px;
height: 500px;
background: #ff00ff;
}
</style>
</head>
<body>
<div class=uno onclick=scrollTo()>
Clicca
</div>
<div class=due id=div_id></div>
</body>
More From » jquery