topolino
11-04-2012, 10:26 PM
I downloaded some time ago a java script file which I have used on a couple of my websites. Recently I discovered an issue whereby if you open the Favorites box in MS Internet Explorer and use the scroll bar at the bottom of the page to scroll the web page right, whilst the favorites window is open, the floating menu moves across with the page instead of staying on the right hand edge of the screen. Does any one know what could be causing this to happen and is it an issue with the position "absolute"?
Any help greatly appreciated
Here is the code I am using which is exactly as per that I downloaded:
if (!document.layers)
document.write('<div id="Floater" style="position:absolute">')
document.write('<layer id="Floater">');
document.write('<a href="../index.html"><img src="../images/graphics/float-home2.gif" border="0" vspace="1"></a><br>');
document.write('<a href="../contactus.htm"><img src="../images/graphics/float-contactsmall.gif" border="0" vspace="1"></a><br>');
document.write('<a href="../sitemap.htm"><img src="../images/graphics/float-map2.gif" border="0" vspace="1"></a><br>');
document.write('<a href="#top"><img src="../images/graphics/float-top2.gif" border="0" vspace="1"></a><br>');
document.write('</layer>');
if (!document.layers)
document.write('</div>')
function FloatMenu()
{
var Xloc = 0,
Yloc = 278;
var ns = (navigator.appName.indexOf("Netscape") != -1);
function SetMenu(id)
{
var GetElements=document.getElementById?document.getElementById(id):document.all?document.all[id]:document.layers[id];
if(document.layers)GetElements.style=GetElements;
GetElements.sP=function(x,y){this.style.right=x;this.style.top=y;};
GetElements.x = Xloc;
GetElements.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
GetElements.y -= Yloc;
return GetElements;
}
window.LoCate_XY=function()
{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - Yloc - ftlObj.y)/15;
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("LoCate_XY()", 10);
}
ftlObj = SetMenu("Floater");
LoCate_XY();
}
FloatMenu();
// End -->
Any help greatly appreciated
Here is the code I am using which is exactly as per that I downloaded:
if (!document.layers)
document.write('<div id="Floater" style="position:absolute">')
document.write('<layer id="Floater">');
document.write('<a href="../index.html"><img src="../images/graphics/float-home2.gif" border="0" vspace="1"></a><br>');
document.write('<a href="../contactus.htm"><img src="../images/graphics/float-contactsmall.gif" border="0" vspace="1"></a><br>');
document.write('<a href="../sitemap.htm"><img src="../images/graphics/float-map2.gif" border="0" vspace="1"></a><br>');
document.write('<a href="#top"><img src="../images/graphics/float-top2.gif" border="0" vspace="1"></a><br>');
document.write('</layer>');
if (!document.layers)
document.write('</div>')
function FloatMenu()
{
var Xloc = 0,
Yloc = 278;
var ns = (navigator.appName.indexOf("Netscape") != -1);
function SetMenu(id)
{
var GetElements=document.getElementById?document.getElementById(id):document.all?document.all[id]:document.layers[id];
if(document.layers)GetElements.style=GetElements;
GetElements.sP=function(x,y){this.style.right=x;this.style.top=y;};
GetElements.x = Xloc;
GetElements.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
GetElements.y -= Yloc;
return GetElements;
}
window.LoCate_XY=function()
{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - Yloc - ftlObj.y)/15;
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("LoCate_XY()", 10);
}
ftlObj = SetMenu("Floater");
LoCate_XY();
}
FloatMenu();
// End -->