I am working in a floting menu for a website, I found this cool script, it works great, but I need to limit the movement of the menu to a table area, right now it goes up and down through the whole body, is there a quick fix for this? please help.
Thanks. - <script>
-
if (!document.layers)
-
document.write('<div id="divStayTopLeft" style="position:absolute">')
-
</script>
-
-
</p><layer id="divStayTopLeft">
-
-
<!--EDIT BELOW CODE TO YOUR OWN MENU-->
-
<table border="1" width="110" cellspacing="0" cellpadding="0">
-
<tr>
-
<td width="100%" bgcolor="#CCCCCC">
-
<p align="center"><b><font size="4" face="Arial Narrow, Arial">Quick Links</font></b></td>
-
</tr>
-
<tr>
-
<td width="100%" bgcolor="#FFFFFF"> <p align="left"> <img src="images/s" width="5" height="1"><a href="http://www.dynamicdrive.com"><font size="3" face="Arial Narrow, Arial">Contact
-
Us</font></a><font size="3" face="Arial Narrow, Arial"><br>
-
<img src="images/s" width="5" height="1"><a href="http://www.dynamicdrive.com/new.htm">How To Pay</a><br>
-
<img src="images/s" width="5" height="1"><a href="http://www.dynamicdrive.com/hot.htm">About Us</a><br>
-
<img src="images/s" width="5" height="1"><a href="http://www.dynamicdrive.com/faqs.htm">FAQs</a><br>
-
<img src="images/s" width="5" height="1"><a href="http://www.dynamicdrive.com/morezone/">About Shipping</a></font></td>
-
</tr>
-
</table>
-
<!--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 = 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>
2 2135
That is Javascript you're showing us in a Java forum. Those two languages have
nothing much in common despite their name. I'll move your question over to the
Javascript forum.
kind regards,
Jos (mod)
I am working in a floting menu for a website, I found this cool script, it works great, but I need to limit the movement of the menu to a table area, right now it goes up and down through the whole body, is there a quick fix for this? please help.
Get the dimensions of the table (the top/left and width/height properties). From these, you can determine the 'bounding box' and where the menu should stay.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: JHR |
last post by:
Hey all,
I'm trying to make a sidebar box float to the right of various items,
and for those items to wrap if a user shrinks his browser window.
Instead, in every browser I've tried except for...
|
by: Christina Joch |
last post by:
Here´s the script for my floating menu.
Is it possible to assign it to a table cell and if yes how to do it?
I hope you mean what I want to do?
Thanks for help,
lg
Christina
<!-- Start
if...
|
by: Bob |
last post by:
Apparently customizing the system menu in a Form requires API calls... that's
fine, but RemoveMenu doesn't work. Will I have to pop up my own menu to get rid
of certain selections?
Bob
|
by: jemcgui |
last post by:
I've been building a site that has a quirk in it. It will display just as intended in IE but not firefox. The left "nav" div which is floating left will be forced down to the bottom of the page. The...
|
by: bdbeames |
last post by:
I have a menu on the right side of my page and a flash object in the center. When a certain option in the menu is select a sub menu pops and floats left. The problem is, depending on the browser...
|
by: Parul Bagadia |
last post by:
I just wrote a code for myself to clear certain things...........
When i made this program to execute in turbo c++ it didnt.....
it showed following error.
I have pasted the output after code is...
|
by: alck1234 |
last post by:
Hi,
I need help on my mini project on object orientated programming. The
question goes like this:
A mini-mart has just installed a bar code reader to improve efficiency
at their checkouts....
|
by: Jason Carlton |
last post by:
I'm working with the cookie-cutter code located here:
http://www.jtricks.com/javascript/navigation/floating.html
Very helpful script, BTW!
I'm trying to modify it, though, so that the menu...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |