7Priest7
June 27th, 2007, 01:22 PM
<script type="text/javascript">
var handImage=new Array("across.gif","down.gif")
var IE = document.attachEvent ? true:false;
var DOM = document.addEventListener ? true: false;
var currentX=0,currentY=0;
var currentCell,currentColor="white",across=true,keyNum;
function init() {
var currentCell=document.getElementById('grid00');
currentColor="yellow";
currentCell.style.backgroundcolor=currentColor;
document.onkeydown=getKey;
writeClues();
}
function getKey(e)
{
if (IE) keyNum = event.keyCode;
else if (DOM) keyNum = e.keyCode;
if(keyNum==32) { toggleDirection(); }
else if (keyNum ==37||keyNum==38||keyNum==39||keyNum==40) { moveCursor(); }
else { writeGuess(); }
}
function toggleDirection()
{
if(across==true) { across = false;
document.images[1].src=handImage[1]; }
else if(across==false) { across = true;
document.images[1].src=handImage[0]; }
}
</script>
It is failing to apply the attributes like the yellow background color or the new image...
Any/All help appreciated
Please and Thank You
Alex
var handImage=new Array("across.gif","down.gif")
var IE = document.attachEvent ? true:false;
var DOM = document.addEventListener ? true: false;
var currentX=0,currentY=0;
var currentCell,currentColor="white",across=true,keyNum;
function init() {
var currentCell=document.getElementById('grid00');
currentColor="yellow";
currentCell.style.backgroundcolor=currentColor;
document.onkeydown=getKey;
writeClues();
}
function getKey(e)
{
if (IE) keyNum = event.keyCode;
else if (DOM) keyNum = e.keyCode;
if(keyNum==32) { toggleDirection(); }
else if (keyNum ==37||keyNum==38||keyNum==39||keyNum==40) { moveCursor(); }
else { writeGuess(); }
}
function toggleDirection()
{
if(across==true) { across = false;
document.images[1].src=handImage[1]; }
else if(across==false) { across = true;
document.images[1].src=handImage[0]; }
}
</script>
It is failing to apply the attributes like the yellow background color or the new image...
Any/All help appreciated
Please and Thank You
Alex