Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:10
floating switch menu
Poster: brunch43
Dated: Sunday March 26 2006 - 17:16:51 BST
hello, i have a problem with this floating menu, I would like the first drop down menu not to be a drop down menu at all, i would like it to be the home link, but i still would like it to be part of the floating menu, the code is right off the dynamic dhtml website, this is the code for the switch menu :
http://www.dynamicdrive.com/dynamicinde ... hmenu2.htm
and the code for the floating menu is found here:
http://www.dynamicdrive.com/dynamicinde ... icmenu.htm
what i did was just insert the switch menu code into the floating menu code, any help would be appreciated , thanks
more on the problem
Poster: brunch43
Dated: Sunday March 26 2006 - 18:09:19 BST
here im just including the code for the menu, but the style sheets are the same from that of the websites, ive also have another problem where i cant even see the menu on IE...im not sure why at all, im running updated versions of both firefox and IE....(i mainly use firefox, and the code works fine on it)...heres the code
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="robots" content="noindex,nofollow">
<link rel="stylesheet" type="text/css" href="sddm.css" />
</script>
</head>
<body>
something will eventually go here, im just working with the menu first
<br />
</body>
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft">
<!--EDIT BELOW CODE TO YOUR OWN MENU-->
<script language="JavaScript" type="text/javascript" src="menu.js"></script>
<!--------Start Menu---------->
<div class="mainDiv" state="0">
<div class="topItem" classOut="topItem" classOver="topItemOver" onMouseOver="Init(this);" ><center>Home</center></div>
<div class="dropMenu" >
<div class="subMenu" state="0">
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.dynamicdrive.com">no links here</a></span><br />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.javascriptkit.com">no links here</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.codingforums.com">no links here</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.builder.com">no links here</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.cssdrive.com">no links here</a></span>
</div>
</div>
</div>
<!--------Start Menu---------->
<div class="mainDiv" state="0">
<div class="topItem" classOut="topItem" classOver="topItemOver" onMouseOver="Init(this)" > Top Ten List</div>
<div class="dropMenu" >
<div class="subMenu" state="0">
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.slashdot.org">Slash Dot</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://news.com">News.com</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://wired.com">Wired News</a></span>
</div>
</div>
</div>
<!--------End Menu---------->
<!--------Start Menu---------->
<div class="mainDiv" state="0">
<div class="topItem" classOut="topItem" classOver="topItemOver" onMouseOver="Init(this)" > Prevention Toolkit</div>
<div class="dropMenu" >
<div class="subMenu" state="0">
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://cnn.com">CNN</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://msnbc.com">MSNBC</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://news.bbc.co.uk">BBC News</a></span>
</div>
</div>
</div>
<!--------End Menu---------->
<!--------Start Menu---------->
<div class="mainDiv" state="0">
<div class="topItem" classOut="topItem" classOver="topItemOver" onMouseOver="Init(this)" > Help Center</div>
<div class="dropMenu" >
<div class="subMenu" state="0">
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://cnn.com">CNN</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://msnbc.com">MSNBC</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://news.bbc.co.uk">BBC News</a></span>
</div>
</div>
</div>
<!--------End Menu---------->
<!--END OF EDIT-->
</layer>
<script type="text/javascript">
/*
Floating Menu script- Roy Whittle (http://www.javascript-fx.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
//Enter "frombottom" or "fromtop"
var verticalpos="frombottom"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX = 30,
startY = 300;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="robots" content="noindex,nofollow">
<link rel="stylesheet" type="text/css" href="sddm.css" />
</script>
</head>
<body>
something will eventually go here, im just working with the menu first
<br />
</body>
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft">
<!--EDIT BELOW CODE TO YOUR OWN MENU-->
<script language="JavaScript" type="text/javascript" src="menu.js"></script>
<!--------Start Menu---------->
<div class="mainDiv" state="0">
<div class="topItem" classOut="topItem" classOver="topItemOver" onMouseOver="Init(this);" ><center>Home</center></div>
<div class="dropMenu" >
<div class="subMenu" state="0">
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.dynamicdrive.com">no links here</a></span><br />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.javascriptkit.com">no links here</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.codingforums.com">no links here</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.builder.com">no links here</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.cssdrive.com">no links here</a></span>
</div>
</div>
</div>
<!--------Start Menu---------->
<div class="mainDiv" state="0">
<div class="topItem" classOut="topItem" classOver="topItemOver" onMouseOver="Init(this)" > Top Ten List</div>
<div class="dropMenu" >
<div class="subMenu" state="0">
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.slashdot.org">Slash Dot</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://news.com">News.com</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://wired.com">Wired News</a></span>
</div>
</div>
</div>
<!--------End Menu---------->
<!--------Start Menu---------->
<div class="mainDiv" state="0">
<div class="topItem" classOut="topItem" classOver="topItemOver" onMouseOver="Init(this)" > Prevention Toolkit</div>
<div class="dropMenu" >
<div class="subMenu" state="0">
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://cnn.com">CNN</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://msnbc.com">MSNBC</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://news.bbc.co.uk">BBC News</a></span>
</div>
</div>
</div>
<!--------End Menu---------->
<!--------Start Menu---------->
<div class="mainDiv" state="0">
<div class="topItem" classOut="topItem" classOver="topItemOver" onMouseOver="Init(this)" > Help Center</div>
<div class="dropMenu" >
<div class="subMenu" state="0">
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://cnn.com">CNN</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://msnbc.com">MSNBC</a></span><BR />
<span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://news.bbc.co.uk">BBC News</a></span>
</div>
</div>
</div>
<!--------End Menu---------->
<!--END OF EDIT-->
</layer>
<script type="text/javascript">
/*
Floating Menu script- Roy Whittle (http://www.javascript-fx.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
//Enter "frombottom" or "fromtop"
var verticalpos="frombottom"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX = 30,
startY = 300;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
Poster: Ruth
Dated: Sunday March 26 2006 - 18:31:59 BST
Hi Brunch,
I'm sorry, we can't help here with that. This is a forum for the Milonic Menu and we have no idea what any problem with the two menus you posted would be.
If you are interested, the Milonic menu will do exactly what you want and I'd be glad to help you set it up. The Milonic menu is also cross browser so it isn't limited to IE as the other is.
For information on licenses to see if you qualify for a free one, check here:
http://www.milonic.com/licensing.php
And the collapsible menu example is here: http://www.milonic.com/treemenu/
The one you want is the top one, the collapse menu. When you have a license that top Milonic item will not show, and as you can see the Home item is only a link, other items below it open 'submenus' and that menu can be made to float. Post back if you need any help.
Ruth