PDA

View Full Version : Floating Menu Script



sandiegocio
01-11-2008, 05:14 PM
1) Script Title: Floating Menu Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/staticmenu.htm

3) Describe problem: Menu does not float // "Forgive me as I know not what I do"! ((Text content is a place holder)) - I copied the script with no changes.
The cintent was shortent to fit the forum.


The html source is as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta
content="text/html; charset=ISO-8859-1"
http-equiv="content-type"><title>test1</title></head>
<body><div id="lipsum"><p>Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Nam
iaculis, nulla ac placerat dictum, lorem ipsum venenatis nisl, ut
iaculis erat odio vel justo. Nulla felis odio, mattis vel, sagittis sit
amet, ultrices quis, nisi. Proin commodo, elit a posuere pellentesque,
arcu mauris iaculis turpis, ac tempus felis leo eu metus. Mauris cursus
mi vel tortor. Vestibulum non dolor. Aliquam convallis suscipit elit.
Praesent ut metus vitae neque commodo aliquet. Integer semper
sollicitudin ligula. Donec lorem nibh, lobortis porta, tincidunt
laoreet, rutrum eu, mauris. Pellentesque dui nisl, dapibus eget,
laoreet vel, semper ac, mauris. Nulla facilisi. Fusce risus ante,
vestibulum at, vestibulum sed, tincidunt vitae, nisl. In hac habitasse
platea dictumst. </p>
<br><p>Nulla eget libero et lectus
fermentum rutrum. Pellentesque
velit. Nullam lectus velit, placerat vitae, condimentum sed, elementum
eu, leo. Morbi ac diam. Aenean ultricies. Sed viverra justo.
Suspendisse potenti. Integer pellentesque. Vivamus elit magna, gravida
et, lobortis sed, semper at, elit. Vivamus leo. Aenean porttitor purus
ut nunc. Vestibulum ante ipsum primis in faucibus orci luctus et
ultrices posuere cubilia Curae; Nunc lacinia mi in ligula. Curabitur a
urna quis neque tincidunt varius. Morbi libero nunc, venenatis in,
eleifend ac, bibendum semper, erat. Aenean odio lorem, volutpat
euismod, sagittis vel, sodales eget, velit. </p>
<p>Vestibulum ante ipsum primis in faucibus orci luctus et
ultrices posuere cubilia Curae; Mauris mattis libero eu neque. Nam eu
felis volutpat enim porta facilisis. Aliquam erat volutpat. Maecenas
laoreet, arcu sagittis eleifend lobortis, dolor orci volutpat nulla,
eget nonummy dolor velit nec velit. Nunc varius eros vel nibh.
Phasellus tempor bibendum nisl. Vestibulum tincidunt. Morbi sit amet
nisi eu felis venenatis interdum. Fusce volutpat. Curabitur ornare
tellus ac risus. Nullam placerat odio sit amet quam. Praesent sed
libero. Maecenas ornare odio et sem. Praesent vitae metus. Pellentesque
orci neque, ultricies ac, volutpat non, tristique quis, enim. </p>
<p>Fusce justo lectus, eleifend non, consequat ac, sollicitudin
quis, ante. Cras laoreet tortor vitae dui. Proin ante est, dignissim
et, imperdiet a, volutpat vel, odio. Suspendisse eleifend bibendum
libero. Etiam mi enim, dictum sit amet, placerat in, dapibus et, ipsum.
Ut odio. Fusce dictum. Suspendisse consectetuer lacus non nisl. Nulla
at augue non arcu sodales mattis. Maecenas tincidunt hendrerit nisl.
Pellentesque habitant morbi tristique senectus et netus et malesuada
fames ac turpis egestas. </p>
<p>Pellentesque eu dui a justo tempor consectetuer. Quisque id
quam. Aliquam erat volutpat. Nunc fermentum, augue eget posuere
fermentum, purus massa imperdiet massa, vel iaculis risus urna non sem.
Aliquam erat volutpat. In hac habitasse platea dictumst. Class aptent
taciti sociosqu ad litora torquent per conubia nostra, per inceptos
hymenaeos. Sed sit amet velit. Quisque eleifend eleifend ante. Vivamus
scelerisque, eros ac sagittis eleifend, ligula ligula aliquam ante, vel
faucibus nulla massa eget ligula. Donec feugiat. Donec convallis lacus
eu elit. Phasellus dictum tellus ut turpis elementum pretium. Fusce
quis lorem. Integer et enim. Maecenas in ipsum. Aenean porttitor nulla
a justo. </p>
<p>Nunc convallis consectetuer est. Aenean sed neque. Cras ut
massa. Duis turpis nisl, porttitor a, tempor vel, placerat eu, enim.
Sed sed augue at nunc auctor eleifend. Mauris pellentesque elit id
erat. Duis rutrum nisi nec ligula. Etiam diam odio, semper ac,
convallis quis, facilisis nec, neque. Nulla faucibus varius urna. Proin
feugiat, magna sit amet malesuada congue, sapien tellus iaculis est,
vel vehicula nisl lorem a turpis. Integer dapibus. In hac habitasse
platea dictumst. Maecenas risus. </p>
<p>Nullam porttitor convallis mauris. Duis in nulla eget nunc
convallis iaculis. Donec odio tellus, dignissim ac, iaculis sed,
ullamcorper vitae, diam. Aliquam in pede. In egestas sagittis nisi.
Aenean molestie nulla ac leo. Pellentesque accumsan luctus quam.
Suspendisse ultricies. Vestibulum ante ipsum primis in faucibus orci
luctus et ultrices posuere cubilia Curae; Vivamus id ligula.
</p></div><br><script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script><layer id="divStayTopLeft"><!--EDIT BELOW CODE TO YOUR OWN MENU-->
</layer><table border="1" cellpadding="0"
cellspacing="0" width="130"><tbody><tr><td
bgcolor="#ffffcc" width="100%"><p align="center"><b><font
size="4">Menu</font></b></p></td>
</tr><tr><td bgcolor="#ffffff" width="100%"><p
align="left"> <a href="http://www.dynamicdrive.com">Dynamic
Drive</a><br>
<a href="http://www.dynamicdrive.com/new.htm">What's New</a><br>
<a href="http://www.dynamicdrive.com/hot.htm">What's Hot</a><br>
<a href="http://www.dynamicdrive.com/faqs.htm">FAQs</a><br>
<a href="http://www.dynamicdrive.com/morezone/">More Zone</a></p></td>
</tr></tbody></table><!--END OF EDIT--><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 = 3,
startY = 150;
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>
</body></html>

==========
thanks // Stu

williamb
01-11-2008, 10:10 PM
I have the same exact problem...

Personally I would like to have embedded in this script the Slashdot menu {http://www.dynamicdrive.com/dynamicindex1/slashdot.htm}. That is the solution I was really looking forward to finding.

But I would be happy to try to figure that one out more later if this menu system functioned first.

sandiegocio
01-12-2008, 06:56 PM
The floating menu really solves navigation problems when clients insist in a very long page that scrolls forever.

Can anyone solve this or have another suggestion?

((client meeting Monday))

Thanks
Stu
http://sandiegocio.blogspot.com/

sogon
04-13-2008, 04:12 AM
No one looking into this issue??? I tried saving it in a html file and I was able to see it floating.

However, when I tried using it in my blog under blogger.com, the thing just won't float and would get stuck there...

Someone look into this please...