Guest_imported
New member
- Jan 1, 1970
- 0
Hi!<br>
<br>
I wrote a script that will change a button on a mouseover, a mouseout and on a mousedown. It works very well, however I would like the "button" to change and stay changed when someone clicks on it (mousedown). However I also want the button to change then change back when the mouse travels over it. I can do the second with no problem, but I can't see any way of telling the script to NOT change the button if it is clicked, until another button is clicked.<br>
Here is the code snippet that I am working with<br>
<br>
I set up the images like so:<br>
<br>
image1= new Image();<br>
image1.src = "images/Home1.jpg";<br>
image1on = new Image();<br>
image1on.src = "images/Home2.jpg";<br>
image1clik = new Image();<br>
image1clik.src = "images/Home3.jpg";<br>
<br>
Throw these functions in:<br>
function on(name) {<br>
document[name].src = eval(name + "on.src");<br>
}<br>
function off(name) {<br>
document[name].src = eval(name + ".src");<br>
} <br>
function clik(name) {<br>
document[name].src = eval(name + "clik.src");<br>
}<br>
<br>
Then use the following HTML to display the mess:<br>
<br>
<a href="home.html" target="main"; <br>
onMouseOver="on('image1')"; <br>
onMouseOut="off('image1')"; <br>
OnMouseDown="clik('image1')"><br>
<img src="images/Home1.jpg" border="0" name="image1" WIDTH="180" HEIGHT="50"></a> <br>
<br>
If anybody can figure out how to keep the button down (re: image3.jpg) untill another button is clicked, I would REALLY appreciate it. <br>
<br>
TIA<br>
<br>
John Vogel
<br>
I wrote a script that will change a button on a mouseover, a mouseout and on a mousedown. It works very well, however I would like the "button" to change and stay changed when someone clicks on it (mousedown). However I also want the button to change then change back when the mouse travels over it. I can do the second with no problem, but I can't see any way of telling the script to NOT change the button if it is clicked, until another button is clicked.<br>
Here is the code snippet that I am working with<br>
<br>
I set up the images like so:<br>
<br>
image1= new Image();<br>
image1.src = "images/Home1.jpg";<br>
image1on = new Image();<br>
image1on.src = "images/Home2.jpg";<br>
image1clik = new Image();<br>
image1clik.src = "images/Home3.jpg";<br>
<br>
Throw these functions in:<br>
function on(name) {<br>
document[name].src = eval(name + "on.src");<br>
}<br>
function off(name) {<br>
document[name].src = eval(name + ".src");<br>
} <br>
function clik(name) {<br>
document[name].src = eval(name + "clik.src");<br>
}<br>
<br>
Then use the following HTML to display the mess:<br>
<br>
<a href="home.html" target="main"; <br>
onMouseOver="on('image1')"; <br>
onMouseOut="off('image1')"; <br>
OnMouseDown="clik('image1')"><br>
<img src="images/Home1.jpg" border="0" name="image1" WIDTH="180" HEIGHT="50"></a> <br>
<br>
If anybody can figure out how to keep the button down (re: image3.jpg) untill another button is clicked, I would REALLY appreciate it. <br>
<br>
TIA<br>
<br>
John Vogel