Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

visibility of page elements 1

Status
Not open for further replies.

blues77

Programmer
Jun 11, 2002
230
CA
is there anyway to to control if a particular part of a page is displayed depending on if the mouse is rolled over it. for example, if i have a list of links and i only want them displayed if the user rolls his/her mouse over a particular piece of text. i know i have to use the onmouseover event but i don't know how to change the visibility of the links. any help would be greatly appreciated.

thanks
 
Check out this example it's just ONE way(there are more):

Click twice on each Header(looks like a link)
You can also change the <SPAN> tags to <DIV>.

<html>
<head>
<script language=&quot;JavaScript&quot;>
function doit2(header)
{
var head=header.style;
if (head.display==&quot;none&quot;)
{
head.display=&quot;&quot;;
}
else
{
head.display=&quot;none&quot;;
}
}
</script>
</head>
<body>
<H3 style=&quot;cursor:hand&quot; onclick=&quot;doit2(document.all[this.sourceIndex+1])&quot;>SECOND HEADING HERE</H3>
<SPAN style=&quot;display: none&quot;>SECOND CONTENT HERE</SPAN>
<H3 style=&quot;cursor:hand&quot; onclick=&quot;doit2(document.all[this.sourceIndex+1])&quot;>SECOND 2342345</H3>
<SPAN style=&quot;display: none&quot;>SECOND 2341234 CONTENT HERE</SPAN>
<H3 style=&quot;cursor:hand&quot; onclick=&quot;doit2(document.all[this.sourceIndex+1])&quot;>SECOND asdfasdfasdf</H3>
<SPAN style=&quot;display: none&quot;>SECOND asdfasdfa CONTENT HERE</SPAN>
</body>
</html>

Hope this points you in the right direction,
Erik <!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top