Can a mouseover be used to make a layer visible/invisible?

I

IndyGreen

AND can it effect a layer in a different frame?
I am designing a very simple frames site (to match my ability) but I want to
have a mouseover effect in my navigation frame to make visible/invisible(on
mouse out) a layer(graphic) in another frame.
I have tried applying a change property behavior to the navigation button
and selected the layer ID but it doesn't seem to work. Am I on the right
track or is this even possible?
Thanks!
- Larry
 
T

Trevor L.

IndyGreen said:
AND can it effect a layer in a different frame?
I am designing a very simple frames site (to match my ability) but I
want to have a mouseover effect in my navigation frame to make
visible/invisible(on mouse out) a layer(graphic) in another frame.
I have tried applying a change property behavior to the navigation
button and selected the layer ID but it doesn't seem to work. Am I on
the right track or is this even possible?
Thanks!
- Larry

Part 1 (How to hide/reveal a div)
<a href="#" onmouseover="hideit('hidediv')"
onmouseout="hideit('hidediv')">Show text</a>
<div id="hidediv" style="display:none">
Some text here
</div>

The function hideit is
function hideit(elid)
{
var e = document.getElementById(elid).style
e.display = (e.display != 'block') ? "block" : "none"
}

Part 2 (How to do it in another frame)
I know how to do this once, but I've forgotten since I stopped using frames.

If you don't get an answer in the next 18 hours (by 1200 AEDST 18 March),
I'll have another look
 
T

Trevor L.

Trevor said:
Part 1 (How to hide/reveal a div)
<a href="#" onmouseover="hideit('hidediv')"
onmouseout="hideit('hidediv')">Show text</a>
<div id="hidediv" style="display:none">
Some text here
</div>

The function hideit is
function hideit(elid)
{
var e = document.getElementById(elid).style
e.display = (e.display != 'block') ? "block" : "none"
}

Part 2 (How to do it in another frame)
I know how to do this once, but I've forgotten since I stopped using
frames.

To change the style of an element passed into a function as elid where elid
is in a frame named "main",
try changing the function to this
function hideit(elid)
{
var e = top.frames['main'].document.getElementById(elid).style
e.display = (e.display != 'block') ? "block" : "none"
}

I have tried this with frames and it worked. (I changed innerHTML not style,
but the principle is the same.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top