PDA

View Full Version : Making a div visible onMouseOver


Antoniohawk
01-01-2003, 02:47 AM
how do i make a <div> visible onMouseOver? I tried the following


<script>
test.onMouseOver="moreMenu.style.visibility='visible'";
</script>

<div id="moreMonkey" class="moreMenu" name="test"></div>

joeframbach
01-01-2003, 03:15 AM
<div style="visibility:hidden" onMouseOver="this.style.visibility='visible'">i bet you didnt know this even existed!</div>

Antoniohawk
01-01-2003, 05:16 AM
i know wat the prob was, i wasnt using inline styles! THX alot man

Antoniohawk
01-01-2003, 05:26 AM
dude its not working

brothercake
01-01-2003, 06:24 AM
does it start out invisible?

Antoniohawk
01-01-2003, 06:57 AM
yup it starts out being invisible

chrismiceli
01-01-2003, 07:12 AM
my guess is that you can't mouse over something invisible, because i made my own code and it doesn't work either. you might have to make a div around the element and mouseover that to make it visible.

Antoniohawk
01-01-2003, 07:27 AM
well actually i want it to become visible when i mouse over a different div

chrismiceli
01-01-2003, 08:44 AM
is this what you want?

<html>
<head>
<title>test</title>
</head>
<body>
<div style="visibility:hidden" id="id">hi</div>
<div onMouseOver="document.getElementById('id').style.visibility = 'visible'">hi</div>
</body>
</html>

joeframbach
01-02-2003, 11:44 AM
in most cases, you dont want to use keywords for naming elements.
use 'div2' or something

Antoniohawk
01-02-2003, 09:33 PM
thx alot i will give that a try