Forum Moderators: not2easy
I've implemented the CSS options for my site in a standard "floating" CSS tooltip, where the CSS code is:
----
a.options {
position: relative;
}
a.options span {
display: none;
}
a.options:hover span {
display: block;
position: absolute;
z-index: 100;
}
----
When I try to put radio buttons in the tooltip, all the associated JavaScript works fine, but the buttons won't select and deselect as normal: rather, the first option selected will select, and nothing else in the group will show itself as selected after that. When I put them outside the tooltip, they work fine.
Can anyone work out what's going on?
----
<a href="#" onclick="return false;" class="options">Options<span>
<p>
Text size: <input name="textSize" type=radio onclick="ChangeFontSize('standard');"> Standard<input name="textSize" type=radio onclick="ChangeFontSize('largetext');"> Large
</p>
<p>
Contrast: <input name="contrast" type=radio onclick="ChangeContrast('standard');"> Standard<input name="contrast" type=radio onclick="ChangeContrast('highcontrast');"> High
</p>
</span></a>
----
Any help would be greatly apprectiated!
Thanks,
Sam
[edited by: SamF at 4:42 pm (utc) on Mar. 20, 2007]
Validate the code - it will fail on that.
Your anchor is the wrapping element for the tooltip. It's saying "these are my contents, when you click on them, you're going to do what I've defined."
You'll have to recode your tooltip to not rely on making use of the
:hover pseudoclass of anchors, and since IE 6 won't adhere to using that pseudoclass on any other element, you'll have to use onmouseover and onmouseout instead.
BTW, in case others are looking for this, I've found a nice tutorial on doing exactly what you said: <snip>
Thanks!
Sam
[edited by: Robin_reala at 10:40 pm (utc) on Mar. 22, 2007]
[edit reason] Removed URLs as per TOS #13 [webmasterworld.com] [/edit]
Yeah, if you'll check out the Webmaster World Terms of Service [webmasterworld.com] and the CSS Forum's more specific Charter [webmasterworld.com] it will detail rules about posting URIs, style of questions, etcetera. Basically, you're not allowed to drop URIs :)
You are allowed some, like dropping a page on the W3C (I think the quid pro quo is nothing promotional, only reference material,) but often one finds it easier to just not drop any :)