mi potete spiegare perchè al click sul link "su" il div scrolla in alto tranquillamente mentre al link "giu" scrolla (pare) in maniera... esponenziale? provatelo:
<html>
<head>
<script language="javascript">
function su() {
var questosu = document.getElementById('vai').style.top;
distsu = new Array();
distsu = questosu.split("px");
distsu[0] = distsu[0] - 1;
document.getElementById('vai').style.top = distsu [0];
}
function giu() {
var questogiu = document.getElementById('vai').style.top;
distgiu = new Array();
distgiu = questogiu.split("px");
distgiu[0] = distgiu[0] + 1;
document.getElementById('vai').style.top = distgiu[0];
}
</script>
</head>
<body>
<div id="primo">
<div id="vai" style="position: absolute; top: 0px;">
testotestotesto
testotestotesto
testotestotesto
testotestotesto
testotestotesto
testotestotesto
testotestotesto
testotestotesto
testotestotesto
testotestotesto
</div>
</div>
su
giu
</body>
</html>