...

View Full Version : Simple Drop Down (Help)



TheSeeker
07-10-2004, 05:41 PM
This the entire HTML code

<html>
<head>
<title></title>
<style>
#doors{
position:absolute;
top:100px;
visibility:hidden;
}
</style>

<script>

function hide(){
doors.style.visiblity="visible";
doors.style.top=200;
}

</script>

</head>



<body text="#ffffff" bgcolor="#000000">

<a href="#" onMouseOver="(hide());return false"><img src="pink.gif"></a><br>

<div id="doors">
<img src="doors.gif">
</div>

</body>

</html>


=========================================================
Can't get the image(id="doors") to change its visiblity. Feeling really stupid and frustrated as I get this this seemingly simple code to work. Other style properties like positioning are working. Its just that I can't get the visiblity property to change. I think I may be missing something really obvious here; or maybe not. I would really appreciate any help. Thanks in advance.

Basscyst
07-10-2004, 05:53 PM
Not really sure what you are trying to do here, you have doors set to hidden onload then you call the function hide() to make it visible? Just add document.getElementById when referencing the div.

EX.


<html>
<head>
<title></title>
<style>
#doors{
position:absolute;
top:100px;
visibility:hidden;
}
</style>

<script>

function hide(){
document.getElementById('doors').style.visibility="visible";
document.getElementById('doors').style.top=200;
}

</script>

</head>



<body text="#ffffff" bgcolor="#000000">

<a href="#" onMouseOver="(hide());return false"><img src="pink.gif"></a><br>

<div id="doors">
<img src="top_curve.jpg">
</div>

</body>

</html>


Basscyst

TheSeeker
07-10-2004, 06:05 PM
Well I am working on getting the image visiblity to toggle with the function. I know that the function name and its purpose don't match. It started out as a function that hides images, but later when it didnot work I switched it. I am sorry I should have corrected that before posting. Anyways, thanks a lot for the help; the function getElementByID() worked.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum