smithster
10-18-2006, 09:09 AM
So my last post was a great success. Plenty of help given, much appreciated. Can hide tags and I can swap them about.
But! A new question I can't believe I didn't think of!! Website is opened for first time, and oh my god!! I got every single div showing up!!
So, how do I get a div to be hidden on first entry? So it only shows up when it is called upon.
This is the script I am using for my divs at the moment.
<html>
<head>
<script language="JavaScript" type="text/javascript">
function hide(obj){
document.getElementById(obj).style.visibility="hidden";
}
function show(obj){
document.getElementById(obj).style.visibility="visible";
}
</script>
</head>
<body>
<a href="#" onclick="hide('div(id)');return false;">hide div(id)</a>
<a href="#" onclick="show('div(id)');return false;">show div(id)</a>
<span onclick="hide('div2');show('div3');return false;" style="text-decoration:underline;cursor:pointer"> Switch content</span>
</body>
</html>
I am thinking it would need some body onload javascript???
Hope someone can help me!!
Thanks in advance.:cool:
But! A new question I can't believe I didn't think of!! Website is opened for first time, and oh my god!! I got every single div showing up!!
So, how do I get a div to be hidden on first entry? So it only shows up when it is called upon.
This is the script I am using for my divs at the moment.
<html>
<head>
<script language="JavaScript" type="text/javascript">
function hide(obj){
document.getElementById(obj).style.visibility="hidden";
}
function show(obj){
document.getElementById(obj).style.visibility="visible";
}
</script>
</head>
<body>
<a href="#" onclick="hide('div(id)');return false;">hide div(id)</a>
<a href="#" onclick="show('div(id)');return false;">show div(id)</a>
<span onclick="hide('div2');show('div3');return false;" style="text-decoration:underline;cursor:pointer"> Switch content</span>
</body>
</html>
I am thinking it would need some body onload javascript???
Hope someone can help me!!
Thanks in advance.:cool: