PDA

View Full Version : Static Menu



TheBigT
06-23-2005, 04:48 PM
I have 2 pages that I am trying to make two elements stationary. I have googled it but could not find the answer. I think you can use javascript to do this because there is a script in your database that enables you to do this. These two elements are divs and I am not sure if you use CSS (like when putting a background stationary) or javascript. Well here are my two pages and I would like to menus to be stationary so that when you scroll they do not move. Thank you.

http://home.comcast.net/~allbonz89/sc/winner.htm
http://home.comcast.net/~allbonz89/sc/old.htm

And the page that you have the static menu is
http://www.dynamicdrive.com/dynamicindex1/staticmenu3.htm
If that helps any.

Thank you again,
Tony

TheBigT
06-23-2005, 09:13 PM
Also can I do this without taking away the divs because I have a third page that now has this problem except it is with the background... the page name is

http://home.comcast.net/~allbonz89/sc/player.htm

TheBigT
06-24-2005, 11:41 PM
I found a solution for old.htm and player.htm but the script that I used below for these two pages did not work for winner.htm. This is because I used percentages to define the position of the div. Also for the div on that page I define its position from right and top instead of the usual left and right.


<html>
<head>
<title>Floating Div (Bottom Left)</title>
</head>
<body bgcolor="#000000">
<!-- ********************************************************* -->
* You may use this code for free on any web page provided that
* these comment lines and the following credit remain in the code.
* BottomLeft Floating Div from http://www.javascript-fx.com
******************************************************** -->
<div id="divStayBottomLeft" style="position:absolute">
<img src="javascriptfx.gif"/>
</div>
<script type="text/javascript">
function JSFX_FloatBottomLeft()
{
var startX = 10, startY = 50;
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+"px";this.style.top=y+"px";};
el.x = startX;
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
return el;
}
window.stayBottomLeft=function()
{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
fblObj.y += (pY - startY - fblObj.y)/8;
fblObj.sP(fblObj.x, fblObj.y);
setTimeout("stayBottomLeft()", 40);
}
fblObj = ml("divStayBottomLeft");
stayBottomLeft();
}
JSFX_FloatBottomLeft();
</script>
<!-- ********************************************************* -->

<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>

<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>

<!-- ********************************************************* -->
</body>
</html>

TheBigT
06-25-2005, 12:44 AM
Everything is fixed... thanks to anyone who tried to help.