wingedbunny
04-12-2007, 02:36 AM
I'm trying to have invisible layers of text show up as an onClick event, but the code on found doesnt seem to work in firefox and safari, is there any other ways of doing this or modifying this so it works in most browsers?
heres the code: (its from http://www.irt.org/script/225.htm )
<STYLE type="text/css"><!--
#about { visibility: hidden; }
#text2 { visibility: hidden; }
--></STYLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
if (document.layers)
var doc = 'document.', vis = '.visibility';
if (document.all)
var doc = 'document.all.', vis = '.style.visibility';
function show(object) {
if (document.layers || document.all)
eval(doc + object + vis + ' = "visible"');
}
function hide(object) {
if (document.layers || document.all)
eval(doc + object + vis + ' = "hidden"');
}
function hideAll() {
hide('about');
hide('text2');
}
//-->
</SCRIPT>
<link href="style.css" rel="stylesheet" type="text/css" />
</HEAD>
<BODY>
<DIV ID="about">
text goes here~ meow <3
</DIV>
<a href="#" onclick="hideAll();show('about');"> clicky here</a>
<DIV ID="text2">
text block two!
</DIV>
heres the code: (its from http://www.irt.org/script/225.htm )
<STYLE type="text/css"><!--
#about { visibility: hidden; }
#text2 { visibility: hidden; }
--></STYLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
if (document.layers)
var doc = 'document.', vis = '.visibility';
if (document.all)
var doc = 'document.all.', vis = '.style.visibility';
function show(object) {
if (document.layers || document.all)
eval(doc + object + vis + ' = "visible"');
}
function hide(object) {
if (document.layers || document.all)
eval(doc + object + vis + ' = "hidden"');
}
function hideAll() {
hide('about');
hide('text2');
}
//-->
</SCRIPT>
<link href="style.css" rel="stylesheet" type="text/css" />
</HEAD>
<BODY>
<DIV ID="about">
text goes here~ meow <3
</DIV>
<a href="#" onclick="hideAll();show('about');"> clicky here</a>
<DIV ID="text2">
text block two!
</DIV>