473,666 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to restrict a floating menu

4 New Member
Hi guys, i am now doin this website that required a floating menu. the problem is how do i restrict the floating menu to prevent it from goin out of the navigation area when the window is minimize? below are my codes.

var verticalpos="fr ombottom"

if (!document.laye rs)
document.write( '</div>')

function JSFX_FloatTopDi v()
{
var startX = 75,
startY = 420;
var ns = (navigator.appN ame.indexOf("Ne tscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElement ById?d.getEleme ntById(id):d.al l?d.all[id]:d.layers[id];
if(d.layers)el. style=el;
el.sP=function( x,y){this.style .left=x;this.st yle.top=y;};
el.x = startX;
if (verticalpos==" fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.s crollTop + document.body.c lientHeight;
el.y -= startY;
}
return el;
}
window.stayTopL eft=function()
{
if (verticalpos==" fromtop"){
var pY = ns ? pageYOffset : document.body.s crollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.s crollTop + document.body.c lientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8 ;
}
ftlObj.sP(ftlOb j.x, ftlObj.y);
setTimeout("sta yTopLeft()", 10);
}
ftlObj = ml("divStayTopL eft");
stayTopLeft();
}
JSFX_FloatTopDi v();
</script>
Aug 15 '07 #1
1 2153
drhowarddrfine
7,435 Recognized Expert Expert
No speaka da javascript. Show the generated HTML.
Aug 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1370
by: MrNobody | last post by:
I have a situation where I add over a hundred child MenuItems to a parent MenuItem. When I click the parent which shows a listing of all the child menu items, it is too big to fit on the page, so it has these up/down arrows so you can scroll through it. This is great, except this window it drew takes the entire height of my screen so it looks a little silly. How can I restrict the size of this menu, so it shows only like 20 menu items and...
6
6866
by: TyBreaker | last post by:
What is the best way to create a menu bar like the Office menu bar ie one that can dock to the four corners of the screen? Is it a standard windows form or is it some other more specialised control? -- ______ ___ __ /_ __/_ __/ _ )_______ ___ _/ /_____ ____ / / / // / _ / __/ -_) _ `/ '_/ -_) __/ /_/ \_, /____/_/ \__/\_,_/_/\_\\__/_/ /___/
0
1337
by: pat.maher | last post by:
I have an application that is not an mdi but rather made up of multiple sdi forms. I am trying to keep a single set of menus and toobars that change contents depending on the form that has focus. The user has the option to float the dockable windows. When the floating window has focus and they attempt to use the menus or toolbars the focus moves back to the main window and the menu's switch to whichever form got focus.
3
7447
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...
2
1713
by: Dariusz Tomoñ | last post by:
Hi, I have got JS at: http://www.euroadres.pl/b2b.aspx for floating menu - it activates when scrolling down. Under IE it works ok but under FF it doesn't float and what's more it covers a part of billboard. How can I fix the problem. Or eventually where to find similar working script (I googled a half of day).
2
2148
by: yela | last post by:
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>
1
7912
Parul Bagadia
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();
0
1305
by: colin | last post by:
Hi, I have an IDE style editor based on the WeifenLuo.WinFormsUI.Docking code, wich I must say seems realy good. Im trying to activate drop down menus and such from various special command key such as the windows apps key, and then do something like build up a context menu using reflection and picking items in the chain of windows and parent windows wich have a member with my custom ContextMenuAttribute with
0
8863
Oralloy
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...
0
8780
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
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,...
1
6189
isladogs
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...
0
5661
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();...
0
4358
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2005
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.