Hi all,
a quick one here.
I am moving elements on the page clientside and I am going through strange issues.
This one works:
<html>
<head>
<title>Javascript Text</title>
</head>
<body>
<h1 id="title"> DHTML Animation </h1>
<script>
var e = document.all.title;
e.style.position = "absolute";
var frame = 0;
function nextFrame() {
if ( 20 > frame++)
{
e.style.left = (10 * frame) + "px";
setInterval("nextFrame();", 100);
}
}
nextFrame();
</script>
</body>
</html>
This one doesn't:
<html>
<head>
<title>Javascript Text</title>
</head>
<body>
<div id="title"> DHTML Animation </div>
<input type="button" value="click me to move it!" OnClick="move();">
<script>
function move()
{
var frame = 0;
nextFrame(frame);
}
function nextFrame(frame) {
var e = document.all.title;
e.style.position = "absolute";
var fr = frame;
if ( 20 > fr++)
{
e.style.left = (10 * fr) + 'px';
setInterval('nextFrame(' + fr + ');', 100);
}
}
</script>
</body>
</html>
I am getting Permission Denied when accessing (or trying to) the style in the move function.
Any one able to help me?
Thanks in advance,
Cheers,
JI