HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Javascript and Div Menus
Post new topic   Reply to topic    HTML Help Forum Index -> DHTML
View previous topic :: View next topic  
Author Message
danielfolsom



Joined: 26 Sep 2006
Posts: 34

PostPosted: Wed Feb 27, 2008 7:27 am     Javascript and Div Menus Reply with quote

Hey, so today I tried to make a rollover menu-type thing ... where essentially when someone rolled over the header, links would show up in a div under it. That worked, except I also wanted it to be that the text disappeared, and i did this using an onmouse out. Except then the problem was - you couldn't mouse over the links to click them, because they would disappear when the mouse left the header. So, I tried doing a div above the header that included the div I wanted to write to - although this doesn't work much better, any suggestions?
Code:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="right.css" />
<base target="mainFrame">
<script>
function showplans(){
if (document.getElementById('plans').innerHTML.substr(0,1)!="<"){
document.getElementById('plans').innerHTML='<dd><a href="2007/Plans/1stQuarterPlan.html">1st Quarter</a></dd><dd><a href="2007/Plans/2ndQuarterPlan.html">2nd Quarter</a></dd><dd><a href="2007/Plans/3rdQuarterPlan.html">3rd Quarter</a></dd>'
}
else {
document.getElementById('plans').innerHTML=""
}
}
</script>
</head>
<body>
<dl>
<div style="border:1px solid black" onmouseover="showplans()" onmouseout="showplans()">
<dt><h3><span>Plans</span></h3></dt>
<div id="plans"></div>
</div>
</dl>
</body>
</html>
danielfolsom



Joined: 26 Sep 2006
Posts: 34

PostPosted: Wed Feb 27, 2008 7:34 am     Reply with quote

Sorry, solved my own problem - I just had to work it a different way.
Code:

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="right.css" />
<base target="mainFrame">
<script>
function showplans(){
if (document.getElementById('plans').style.display=="none"){
document.getElementById('plans').style.display = ""
}
else {
document.getElementById('plans').style.display = "none";
}
}
</script>
</head>
<body>
<dl>
<div style="border:1px solid black" onmouseover="showplans()" onmouseout="showplans()">
<dt><h3><span>Plans</span></h3></dt>
<div id="plans" style="display:none">
<dd><a href="2007/Plans/1stQuarterPlan.html">1st Quarter</a></dd><dd><a href="2007/Plans/2ndQuarterPlan.html">2nd Quarter</a></dd><dd><a href="2007/Plans/3rdQuarterPlan.html">3rd Quarter</a></dd>
</div></div>
</dl>
</body>
</html>
deep



Joined: 01 Mar 2008
Posts: 1

PostPosted: Sat Mar 01, 2008 9:47 pm     Reply with quote

hi this is a very good site
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> DHTML All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial