superfly404
Technical User
I have a script where I need to have multiple functional hide/show divs that work in the copy
Here's the code I'm using:
<style type="text/css">
div.code
{
background-color: #DDDDDD;
margin: 0px 50px 0px 50px;
}
div.quote
{
margin: 0px 50px 0px 50px;
background-color: #FDFFCA;
}
div.quote p
{
font-style: italic;
margin: 0px 0px 0px 0px;
}
div#commentForm
{
display: none;
margin: 0px 20px 0px 20px;
font-family: Arial, sans-serif;
font-size: .8em;
}
a.commentLink
{
font-family: Arial, sans-serif;
font-size: .8em;
}
img
{
border: 0px;
}
form
{
margin: 0px;
}
</style>
<script type="text/javascript">
function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}
</script>
<a href="javascript:toggleLayer('1');" title="Add a comment to this entry">Copy 1</a>
<div id="1">
Copy 1 goes here</div>
---------------------------------
I tried adding additional code, as such, but didnt work?
<a href="javascript:toggleLayer('2');" title="Add a comment to this entry">Copy 1</a>
<div id="2">
Copy 2 goes here</div>
Any ideas?
Here's the code I'm using:
<style type="text/css">
div.code
{
background-color: #DDDDDD;
margin: 0px 50px 0px 50px;
}
div.quote
{
margin: 0px 50px 0px 50px;
background-color: #FDFFCA;
}
div.quote p
{
font-style: italic;
margin: 0px 0px 0px 0px;
}
div#commentForm
{
display: none;
margin: 0px 20px 0px 20px;
font-family: Arial, sans-serif;
font-size: .8em;
}
a.commentLink
{
font-family: Arial, sans-serif;
font-size: .8em;
}
img
{
border: 0px;
}
form
{
margin: 0px;
}
</style>
<script type="text/javascript">
function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}
</script>
<a href="javascript:toggleLayer('1');" title="Add a comment to this entry">Copy 1</a>
<div id="1">
Copy 1 goes here</div>
---------------------------------
I tried adding additional code, as such, but didnt work?
<a href="javascript:toggleLayer('2');" title="Add a comment to this entry">Copy 1</a>
<div id="2">
Copy 2 goes here</div>
Any ideas?