Friday 15 June 2012

javascript - Onmousedown / OnmouseUp issue with website -


I am trying to change the color of my arrow (image files) when I click with this code:

  & lt; Img id = "imag" src = "img / left.png" onmousedown = "down-left ()" onmouseup = "uplieft ()" & gt; & Lt; Img id = "img" src = "img / right.png" onmousedown = "mouseDown ()" onmouseup = "mouseUp ()" & gt; & Lt; Script & gt; Function mouse down () {document.getElementById ("img"). Src = "img / right-hover.png"; } Function mouseUp () {document.getElementById ("img"). Src = "img / right.png"; } Function down-left () {document.getElementById ("image"). Src = "img / left-hover.png";} function uplift () {document.getElementById ("imag"). Src = "img / left.png";} & lt; / Script & gt;  

This idea occurs when one of the images is clicked, as long as they are clicked, they change the colors, but the code is just right.png Works for the image and I have tried many things to create for both, but with no luck! Am i seeing something I would appreciate some answers or assistance very much.

If the image is clicked, change the page or refresh the page so that you can find out Php should use whether the link was clicked on or not and the image was changed


No comments:

Post a Comment