Hi I have a dynamic menu on my site and it uses
javascript to make slide up and down the page.
I think its pretty cool but it seems that it works independently of the
page so if you try and reduce the width of the window, it starts getting messed up.
Have a look here and you will see what I mean: my website
One other thing I don't like is that it forces the window to 100% each
time you click a link, I am sure that will annoy people.
Is there an easy way to stop the central column from "crashing into" the menu when the window width is reduced ?
And how do I stop this 100% window without messing the page up ?
Thanks for any advice.
The menu code is here :
(there are a few lines of php but the main part is all javascript) -
-
/*
-
* Next display the menu.
-
*
-
*
-
*/
-
$start = 0;
-
$last = 20;
-
-
$sql = "SELECT sc_name, user_id FROM clients
-
WHERE confirm = 'y'
-
AND type = 'E'
-
ORDER BY lig_pos DESC LIMIT $start,$last";
-
-
$result = mysql_query($sql)
-
or die ("Could not execute STARTER FEATURE query.");
-
-
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
-
{
-
$Links[] = $row;
-
}
-
-
-
//--> Output data.
-
-
echo '
-
<div id="divStayTopLeft" style="position:absolute">
-
<div class="menuH">Top Experts</div>
-
<ul class="categorylinks">';
-
-
foreach ($Links as $Link){
-
$the_link = str_replace(" ","%20",$Link['sc_name']);
-
echo "<li><a href=\"/$the_link/internet_marketing/expert/guru_{$Link['user_id']}\"> {$Link['sc_name']}</a></li>";
-
}
-
echo '</ul>';
-
?>
-
-
</div>
-
<script type="text/javascript">
-
-
-
window.moveTo(0,0);
-
window.resizeTo(screen.width,screen.height);
-
-
/*
-
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"
-
-
document.write('<\/div>')
-
-
function JSFX_FloatTopDiv()
-
{
-
var startX = 20,
-
startY = 600;
-
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>
-
-
1 1210 acoder 16,027
Recognized Expert Moderator MVP
The 100% problem is caused by lines 42-43. Remove them.
As for the script, it's a bit of mix-mash of old code/browser detection. You can use position: fixed instead. It works in most modern browsers. It doesn't work in IE6 though, but you can use this fix.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Macamba |
last post by:
Hi all,
I am currently developing a website for a voluntary organisation. It is
my first step in website development. The dynamic menu I developed has
some bugs, which I addressed in another post. In this post I want to ask
you why my code behaves differently in IE, while it behaves like I
expect in Mozilla and Opera. What I would like to see addressed is what
I need to do to get the same behaviour in all 3 browsers. I know each
browser...
|
by: Stromboli |
last post by:
hi people,
My problem is that I need to build a dynamic menu (preferably that
works in all the browsers) that appears when I mouseover a certain
link.
The problem is that I have to declare the menu content in the same
part of the page where the menu goes (BODY). The content of the page
is generated dynamically so I can't put the menu content it on the
headers.
|
by: Nathan Bloomfield |
last post by:
Does anyone know if there is any documentation which relates to Access2k + ?
or can anyone help adjust the code?
I am having trouble converting the DAO references.
TITLE :INF: How to Create a Dynamic Crosstab Report
PRODUCT :Microsoft Access
PROD/VER:1.00 1.10
OPER/SYS:WINDOWS
|
by: biela |
last post by:
Hi
I'm from Poland and I have small question :). I'm looking for sample
example how to create dynamic menu. Generaly my website will see like
that
------------------------------------
2
---------|--------------|-----------
| |
1 | 3 | 4
| |
|
by: vikram |
last post by:
I have to design a page which contains a dynamic generated
menu at left side.Menu will be generated once a user log
in and will remain as it is for the rest of the user
session.
Problem is that due to client requirement i have to avoid
using frames and hence menu and the page will be a single
page.
So is there is any way by which the left hande side menu
block can be cached someway so that dynamic generation can
be avoided each time...
| |
by: mart2006 |
last post by:
I've created a dynamic drop down menu that populates itself with data from a MySQL table. What I would like to do is create a non dynamic drop down menu that alters what is shown in the dynamic menu.
For example, the first menu has three cities London, Paris, New York. If I choose London it populates the second menu with people from London.
Here is the code I have for my dynamic menu
<td valign=top><strong>Name:</strong></td>
<td>...
|
by: RahimAsif |
last post by:
I am writing an application that requires the a portion of the main
menu to be dynamic. The menu has file, panels, view files and help
across the top. The view files sub menu needs to be dynamically
generated, and the dynamic generation needs to occur right when the
user selects this menu item (that is on the Popup event handler).
However, everytime I put following code on the Popup event handler (of
the View Files menuitem) to dynamically...
|
by: benfly08 |
last post by:
Hi,
I used SWT to develop an windows application. In the application there is a dynamic created popup menu. The dynamic part is that i will pass a list of name to be a submenu of one menu item. However, when I code selection event, i cannot access to the list i pass in. Anybody got idea? Below is the code.
public static void setUpMenu(final Shell shell, Menu popUpMenu, final String clientId) {
myShell = shell;
...
|
by: mart2006 |
last post by:
Hi,
I'm fairly new to PHP and I've created a dynamic drop down menu that populates itself with data from a MySQL table. What I would like to do is create a non dynamic drop down menu that alters what is shown in the dynamic menu.
For example, the first menu has three cities London, Paris, New York. If I choose London it populates the second menu with people from London.
Here is the code I have for my dynamic menu
<td...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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: 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...
|
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: 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: 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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |