So, I wrote a small page:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script>
function slide() {
$("#d").slideUp("slow");
document.getElementById("d").innerHTML=Math.random();
$("#d").slideDown("slow");
}
</script>
</head>
<body>
<div id="d"></div>
<button onClick="slide()">do</button>
</body>
</html>
And I don't know why but the text inside div
is changed before the $("#d").slideDown("slow")
, right when the slideUp
begins.
I want it to work so that first #d
slideUp
, then while its height is close to 0 or something the innerHTML will change, and only after that slideDown
.