TheQuestor
12-18-2010, 03:10 PM
<%Function PF(num)%>
<script type="text/javascript">
<!--
function toggleOff()
{
document.getElementById("floatingBox").style.display = "none";
}
//-->
</script>
<div class="post_header" onClick="ToggleReply( <%=num%> )">
<div class="post_pmbutton" id="button_<%=num%>">[+]</div>
<br clear="all">
</div>
<div class="post_content" style="display: none;" id="content_<%=num%>">
<div id="floatingBox">some words here
<a href="#&ID=<%=num%>" title="Close this box" onclick="javascript: toggleOff();">[I Agree]</a>
</div></div>
<%End Function%>
It works fine, as long as it's the only one on the page. Problem is I potentially could have many dozens on any given page and the top one always works but the ones after do not :(
I understand that I basically need to set a variable that is different for each rendition of the code but that is where I am stumped.
I have a message ID from vb that I can pass to the javascript to get each iteration a unique ID I just don't know what to do with the number in javascript. I have NO clue about javascript :(
Each iteration is hidden by default until an anchor is clicked.
Please help clue this poor soul in :)
<script type="text/javascript">
<!--
function toggleOff()
{
document.getElementById("floatingBox").style.display = "none";
}
//-->
</script>
<div class="post_header" onClick="ToggleReply( <%=num%> )">
<div class="post_pmbutton" id="button_<%=num%>">[+]</div>
<br clear="all">
</div>
<div class="post_content" style="display: none;" id="content_<%=num%>">
<div id="floatingBox">some words here
<a href="#&ID=<%=num%>" title="Close this box" onclick="javascript: toggleOff();">[I Agree]</a>
</div></div>
<%End Function%>
It works fine, as long as it's the only one on the page. Problem is I potentially could have many dozens on any given page and the top one always works but the ones after do not :(
I understand that I basically need to set a variable that is different for each rendition of the code but that is where I am stumped.
I have a message ID from vb that I can pass to the javascript to get each iteration a unique ID I just don't know what to do with the number in javascript. I have NO clue about javascript :(
Each iteration is hidden by default until an anchor is clicked.
Please help clue this poor soul in :)