disabling image buttons

I

inonzuk

Hi everyone,

I'm new to javascript and have the following problem:
I have two image buttons:
1)
<td><a href="http://localhost/gamerules.php" target="mainwindow"><img
onMouseOver="return changeRules()" onMouseOut="return
changeRulesBack()" name="b_rules" src="images/b_rules.jpg" width=130
height=90></a></td>
2)
<td><a href="http://localhost/playscreen.php" target="mainwindow"><img
onMouseOver="return changePlay()" onMouseOut="return changePlayBack()"
name="b_play" src="images/b_play.jpg" width=130 height=85></a></td>

I need to do the following: when button 2 is pressed button 1 will
become disabled/unclickable, how do I get this kind of behavior?

thanks in advance for any help
 
I

inonzuk

thanks for the answer, another question is :
1)how can I start with image 1 clickable and image 2 unclickable, and
only after I click image 1 -> image 2 becomes clickable. (i.e.
starting with href empty on image 2 and setting its value when image 1
is clicked).

2)I want to change the image src when the image in unclickable. what is
the correct way to check it (I want to do a "if" condition ... if (href
is empty for that picture) change the src to unclickable image).

I want to do a function "onClick = doThis()"
function doThis(){
if (href is empty){
change the href to clickable link
change the image src to clickable button
}else{
change to empty href
(document.images['b_ru­les'].parentElement.removeAttr­ibute('href')")
change the image src to unclickable button
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top