killboy Posted December 27, 2007 Share Posted December 27, 2007 I have a problem:I was checking Style object's visibility property.I found that a possible value is "collapse" when one is working with rows or columns.I have the following code: <html><head><title>Title</title><style type="text/css">tr.tel2{visibility:collapse}tr.tel3{visibility:collapse}</style><script type="text/javascript">function showtels(){ document.getElementById("tel2").style.visibility="visible"; document.getElementById("tel3").style.visibility="visible"; document.getElementById("moretels").style.visibility="hidden"; document.getElementById("hide_tels").style.visibility="visible";}function hidetels(){ document.getElementById("tel2").style.visibility="collapse"; document.getElementById("tel3").style.visibility="collapse"; document.getElementById("moretels").style.visibility="visible"; document.getElementById("hide_tels").style.visibility="hidden";}</script></head><body><table border="1" style="border-collapse:collapse"><tr><td>Telephone</td><td><input type="text" size="30"> <a class="hidetels" id="hide_tels" onclick="java script:hidetels()" onmouseover="this.style.cursor='pointer'"><small>Hide</small></a> <a onclick="java script:showtels()" onmouseover="this.style.cursor='pointer'" id="moretels"><small>More telephones</small></a></td></tr><tr class="tel2" id="tel2"><td>Telephone 2</td><td><input type="text" size="30"></td></tr><tr class="tel3" id="tel3"><td>Telephone 3</td><td><input type="text" size="30"></td></tr></table></body></html> Its working is simple:When I click on "More telephones", another two fields must appear. When I click on Hide, these disappear.The code works perfectly on Firefox, but when I run it on IE, it says that there's not such "collapse" value.Is there any errors? Is there any way to replace the "collapse" value then?Thanks. Link to comment Share on other sites More sharing options...
Ingolme Posted December 28, 2007 Share Posted December 28, 2007 Collapse doesn't exist in Internet Explorer, but you can change the display instead. object.style.display="none" Link to comment Share on other sites More sharing options...
killboy Posted December 29, 2007 Author Share Posted December 29, 2007 Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.