|
-
Mar 28th, 2003, 04:37 PM
#1
Thread Starter
Fanatic Member
dhtml layers question
i have two div tags. one is visible until a radio button is clicked.
i then have another one shown.
i need to make the first one hidden.
here is my code
Code:
function toggle(id2,id) {
document.all[id2].style.visibility = "visible" ;
document.all[id].style.visiblity = "hidden";
}
<DIV ID="divShowHide" STYLE=" position:relative;visibility:visible; ">
<table>
<tr>
<td>Do you like green eggs and ham?
</td>
</tr>
<tr>
<td><input type="radio" name="answer" onClick="toggle('toggleOff','divShowHide');">
A. Yes</a> <br> <input type="radio" name="answer" onClick="toggle('toggleOff','divShowHide');">
B. No</a> </td>
</tr>
</table>
</DIV>
<div id="toggleOff" style="visibility:hidden;position:relative; ">
<table border="1" bordercolor="#FF9900">
<tr>
<td>who cares what you like.</td>
</tr>
</table>
</div>
any suggestions are welcome.
thanks
-
Mar 29th, 2003, 05:37 AM
#2
This is IE-specific code. 
Code:
function toggle(id2,id) {
if(navigator.userAgent.indexOf("MSIE") != -1 && parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("MSIE")+5)) < 5.5) {
document.all[id2].style.visibility = "visible" ;
document.all[id].style.visiblity = "hidden";
} else {
document.getElementById(id2).style.visibility = "visible";
document.getElementById(id).style.visibility = "hidden";
}
}
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|