ob1wan
02-08-2006, 12:10 AM
<html>
<head>
<title>movement</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function left(){
var x=document.getElementById('player').style.left;
alert(x);
document.getElementById('player').style.left ='1';
}
//-->
</script>
</head>
<body>
<div id="player" style="position:relative; width:44; height:46; z-index:1; left: 279; top: 132;"><img src="tiles/mark.gif" width="44" height="46"></div>
<input type="button" onMouseDown="javascript:left()" name="Submit" value="Submit">
</body>
</html>
im tring to move an image in a layer with a push of a button
what i want it to do is be able to move 5pixels from where it was last at a push not jump to a spot
when i do an alert test it returns the number with px at the end and i cant use += / -= to do anything with
thanx for any help
<head>
<title>movement</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function left(){
var x=document.getElementById('player').style.left;
alert(x);
document.getElementById('player').style.left ='1';
}
//-->
</script>
</head>
<body>
<div id="player" style="position:relative; width:44; height:46; z-index:1; left: 279; top: 132;"><img src="tiles/mark.gif" width="44" height="46"></div>
<input type="button" onMouseDown="javascript:left()" name="Submit" value="Submit">
</body>
</html>
im tring to move an image in a layer with a push of a button
what i want it to do is be able to move 5pixels from where it was last at a push not jump to a spot
when i do an alert test it returns the number with px at the end and i cant use += / -= to do anything with
thanx for any help