codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  DHTML Drop Down Menu  KytanCW at 20:13 on Wednesday, February 18, 2009
 

Hello everyone,

I have found a dhtml drop down menu and am having trouble centering it here is the codes that are part of this menu with no references though (The menu works and I use external CSS and JS (JS is linked through the head and so isn't CSS)) My website to check out what it looks like on my site is http://www.kytancw.com/ and I use XHTML 1.0 strict:

HTML:

<!--Beginning Of Navigation Bar Container-->

<div id="navigationBar_container">

<ul id="sddm">

<li>

<a href="#" onmouseover="mopen('m1')" onmouseout="mclosetime()">

Home

</a>

<div id="m1" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">

<a href="#">

HTML Drop Down

</a>

<a href="#">

DHTML Menu

</a>

<a href="#">

JavaScript DropDown

</a>

<a href="#">

Cascading Menu

</a>

<a href="#">

CSS Horizontal Menu

</a>

</div>

</li>

<li>

<a href="#" onmouseover="mopen('m2')" onmouseout="mclosetime()">

Download

</a>

<div id="m2" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">

<a href="#">

ASP Dropdown

</a>

<a href="#">

Pulldown menu

</a>

<a href="#">

AJAX Drop Submenu

</a>

<a href="#">

DIV Cascading Menu

</a>

</div>

</li>

<li>

<a href="#">

Order

</a>

</li>

<li>

<a href="#">

Help

</a>

</li>

<li>

<a href="#">

Contact

</a>

</li>

</ul>

<div id="empty">

</div>

</div>

<!--Ending Of Navigation Bar Container-->

CSS:

#navigationBar_container {
text-align: center;
position: relative;
bottom: 18px;
}

#sddm {
margin: 0;
padding: 0;
z-index: 30;
}

#sddm li {
margin: 0;
padding: 0;
list-style: none;
float: left;
font-weight: bold;
font-size: 11px;
font-family: arial;
}

#sddm li a {
display: block;
margin: 0 1px 0 0;
padding: 4px 10px;
width: 60px;
background-color: #5970b2;
color: #fff;
text-align: center;
text-decoration: none;
}

#sddm li a:hover {
background-color: #49a3ff;
}

#sddm div {
position: absolute;
visibility: hidden;
margin: 0;
padding: 0;
background-color: #eaebd8;
border: 1px solid #5970b2;
}

#sddm div a {
position: relative;
display: block;
margin: 0;
padding: 5px 10px;
width: auto;
white-space: nowrap;
text-align: left;
text-decoration: none;
background-color: #eaebd8;
color: #2875de;
font-size: 11px;
font-family: arial;
}

#sddm div a:hover {
background-color: #49a3ff;
color: #fff;
}

#empty {
clear: both;
}

JS:

var timeout = 500;

var closetimer = 0;

var ddmenuitem = 0;

function mopen(id)

{

mcancelclosetime();

if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

ddmenuitem = document.getElementById(id);

ddmenuitem.style.visibility = 'visible';

}

function mclose()

{

if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

}

function mclosetime()

{

closetimer = window.setTimeout(mclose, timeout);

}

function mcancelclosetime()

{

if(closetimer)

{

window.clearTimeout(closetimer);

closetimer = null;

}

}

document.onclick = mclose;








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: refresh parent after closing pop up window
•  Passing Password using $ssh->cmd
•  Re: Run a .bat file from VB
•  plz i need help
•  DHTML Drop Down Menu
•  Check this
•  Me new to Dhtml
•  Re: How can use ASP.NET RegularExpressionValidator for alphanumeric 10 digit input
•  Re:information for unlocking


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009