tomjoyce
12-19-2004, 10:41 PM
function getItem(id)
{
var itm = false;
if(document.getElementById)
itm = document.getElementById(id);
else if(document.all)
itm = document.all[id];
else if(document.layers)
itm = document.layers[id];
return itm;
}
function toggleItem(id)
{
itm = getItem(id);
if(!itm)
return false;
if(itm.style.display == 'none')
itm.style.display = 'block';
else
itm.style.display = 'none';
return false;
}
That part is in the header, and this part is in the body:
This is the controller for the next part:
<td valign="top" background="images/test.jpg"><a href="#" onclick="toggleItem('box04')">
<img src="collapse/open.gif" border="0" onClick="close.gif" ></a><strong><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Quick
Links</font></strong></td>
The thing being controlled:
<td width="261" height="131" colspan="87" valign="top" bgcolor="#CCCCCC" id="box04" style="border:solid 2px #004501;">
<ul>
<li><a href="http://www.google.com/" target="_out">http://www.google.com/</a></li>
<li><a href="http://www.shanahan.org/" target="_out">http://www.shanahan.org/</a></li>
</ul>
</td>
My problem is that if you are viewing the page, there are many similar instances of the above, and if you scroll down and click one, it takes you to the top of the page. I want it to remain exactly where the user was. How would I do that?
{
var itm = false;
if(document.getElementById)
itm = document.getElementById(id);
else if(document.all)
itm = document.all[id];
else if(document.layers)
itm = document.layers[id];
return itm;
}
function toggleItem(id)
{
itm = getItem(id);
if(!itm)
return false;
if(itm.style.display == 'none')
itm.style.display = 'block';
else
itm.style.display = 'none';
return false;
}
That part is in the header, and this part is in the body:
This is the controller for the next part:
<td valign="top" background="images/test.jpg"><a href="#" onclick="toggleItem('box04')">
<img src="collapse/open.gif" border="0" onClick="close.gif" ></a><strong><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Quick
Links</font></strong></td>
The thing being controlled:
<td width="261" height="131" colspan="87" valign="top" bgcolor="#CCCCCC" id="box04" style="border:solid 2px #004501;">
<ul>
<li><a href="http://www.google.com/" target="_out">http://www.google.com/</a></li>
<li><a href="http://www.shanahan.org/" target="_out">http://www.shanahan.org/</a></li>
</ul>
</td>
My problem is that if you are viewing the page, there are many similar instances of the above, and if you scroll down and click one, it takes you to the top of the page. I want it to remain exactly where the user was. How would I do that?