Afficher un message
Vieux 18/02/2008, 05h24   #4
MikeL7
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: css hover without link

>Would your approach of using javascript be more reliable, do you think?
If the user disables Javascript, then it will not work

I am not sure how its done on that page, but i made this form that does
basically the same thing, be sure to not have any space after the li tags with
the onclick atribute set, or the behavior won't work in FF or Opera.




<style>
.answer{
font-size:14px;
height:3.5em;
padding-top:1.5em;
padding-left:1em;
cursor:pointer;
cursor:hand;

}

</style>
<body>

<form name="form1" action="" method="post">
<ul style="list-style:none; margin-left:-.5em;">
<li>Are you awake?</li>
<li onmouseover="style.backgroundColor='#FF0000'"
onmouseout="style.backgroundColor='#FFFFFF'"
onclick="this.firstChild.checked=true" class="answer"><input name="radio1"
type="radio" value="yes" />Yes
</li>

<li onmouseover="style.backgroundColor='#FF0000'"
onmouseout="style.backgroundColor='#FFFFFF'"
onclick="this.childNodes[0].checked=true" class="answer"><input name="radio1"
type="radio" value="no" />No
</li>

<li>Are you alive?</li>
<li onmouseover="style.backgroundColor='#FF0000'"
onmouseout="style.backgroundColor='#FFFFFF'"
onclick="this.firstChild.checked=true" class="answer"><input name="radio2"
type="radio" value="yes" />Yes
</li>

<li onmouseover="style.backgroundColor='#FF0000'"
onmouseout="style.backgroundColor='#FFFFFF'"
onclick="this.childNodes[0].checked=true" class="answer"><input name="radio2"
type="radio" value="no" />No
</li>
</ul>
</form>
</body>

  Réponse avec citation
 
Page generated in 0,06107 seconds with 9 queries