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 2162 JosAH 11,448
Recognized Expert MVP
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)
acoder 16,027
Recognized Expert Moderator MVP
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 Internet Explorer (in
Safari, Firefox, and other Mozilla-types), the box ends up overlapping
with the second and third rows of the text (which are in an ordered list
with some 'display: table-cell' formats defined in order to allow
specific...
|
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 (!document.layers)
|
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 main content area on the right is floating right and stays fine. The weird part is that a refresh will always correct this problem. and the problem will not occur on all the pages though they have identical set-ups.
The site is at...
|
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 and OS i.e.(firefix,ubuntu) the submenu is behind the flash. How can i fix this problem. I googled for the last day and the only thing I found was to put the flash in it's own div and set the z-index to -1. This solved nothing.
here is a copy of...
| |
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 over.
But when i executed the same code in microsoft visual c++; it worked without showing any errors.
Can somebody tell me why that happened.
#include<stdio.h>
#include<conio.h>
void assign();
|
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.
Assume that the bar code is to access a file that store the product
descriptions, unit price
and quantity of each product sold in the shop. Assume that there are
only 10 products in
|
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 will scroll relative
to a parent DIV instead of the main window. So, I have something like
this (simplified so that you can copy it to your viewer and see the
problem):
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |