FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Javascript

 


quasar
i'm tring to make something that when you put your mouse over something, stuff apears below it. the problem is though is that i can't view the stuff im hiding.

here's the code.

Code:

<script language="javascript">
function show_div(id)
{
document.getElementById(id).style.visibility = "visible";
}
</script>
.......
<td align='center'><a href='test.htm' id='reguser' onmouseenter='javascript:show_div(d22)'> 22 </a><br><div id='d22' style='visibility:hidden;'><h4>Todays Work</h4></div></td></tr>




any ideas?
HamsterMan
How to solve that, no. But try this...

<script language="javascript">
function show_div(id)
{
document.getElementById(id).style.display="block";
}
</script>
.......
<td align='center'><a href='test.htm' id='reguser' onmouseenter='javascript:show_div(d22)'> 22 </a><br><div id='d22' style='display:none;'><h4>Todays Work</h4></div></td></tr>


Dunno if it works.
Peterssidan
I think you have to pass the id as a string to show_div().
Code:
show_div("d22")
MM357
If you are using Firefox as your web browser, then you can Use Firebug. It will enable you to debug your JavaScript code easily showing you the error message and line number. It has much more benefits moreover.
mgeek
I found a script at DynamicDrive that seems to do what you are describing. It is called Accordion Content Script
Marcuzzo
change:
Code:
onmouseenter='javascript:show_div(d22)'


to

Code:
onmouseover='javascript:show_div("d22")'
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.