ideffect
01-03-2005, 08:22 PM
Hi,
I posted a message last week but have not gotten a responce. I'm trying to use a floating script inside a table but part of the buttons are cut off depending on screen resolution. I would like the button to lay on the middle of the screen after scrolling down the page a little. I don't know how much work this would be to accomplish so I don't know how much to offer. If you think you can do it, let me know how much you want to do it. You can either reply in this message or by PM. If you need more instructions on what I'm trying to accomplish, let me know.
Here is the original post with some more info...
Hello,
I have a site http://www.thevortexbusinessinabox....ent/view/13/40/ that i've been working on. I'm trying to get the floating menu to sit in the center of the page after it moves from the top. The floating menu sits in a frame that starts about 170px from the top. When looking from the very top, the bottom part of the menu is not visible. When scrolling down the page, that section of the menu is never visible. I'm hoping there's a way to adjust for that. I've tried a few diffrent ideas with no luck. The script's location is http://www.dynamicdrive.com/dynamic.../staticmenu.htm
I had to modify the script to work as it does now. I'm going to put the file below.
In the HTML
Code:
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:relative">')
</script>
<layer id="divStayTopLeft">
<?php mosLoadModules ( 'left' );?> <--Mambo Coding
</layer>
The script
Code:
//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX = 0,
startY = 0;
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)/70;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/30;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 20);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
I really like this script but if you know of one that's better suited for what I am trying to do, please let me know.
Thank you for your help!
I posted a message last week but have not gotten a responce. I'm trying to use a floating script inside a table but part of the buttons are cut off depending on screen resolution. I would like the button to lay on the middle of the screen after scrolling down the page a little. I don't know how much work this would be to accomplish so I don't know how much to offer. If you think you can do it, let me know how much you want to do it. You can either reply in this message or by PM. If you need more instructions on what I'm trying to accomplish, let me know.
Here is the original post with some more info...
Hello,
I have a site http://www.thevortexbusinessinabox....ent/view/13/40/ that i've been working on. I'm trying to get the floating menu to sit in the center of the page after it moves from the top. The floating menu sits in a frame that starts about 170px from the top. When looking from the very top, the bottom part of the menu is not visible. When scrolling down the page, that section of the menu is never visible. I'm hoping there's a way to adjust for that. I've tried a few diffrent ideas with no luck. The script's location is http://www.dynamicdrive.com/dynamic.../staticmenu.htm
I had to modify the script to work as it does now. I'm going to put the file below.
In the HTML
Code:
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:relative">')
</script>
<layer id="divStayTopLeft">
<?php mosLoadModules ( 'left' );?> <--Mambo Coding
</layer>
The script
Code:
//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX = 0,
startY = 0;
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)/70;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/30;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 20);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
I really like this script but if you know of one that's better suited for what I am trying to do, please let me know.
Thank you for your help!