Been messing around with some floating menu scripts using Jquery, which i managed to make work on my own website, but when i add another one below it (i want 4) the others stop moving?
http://www.stay-linked.co.uk
Thats one working, just not sure why when i add more that it stops moving (and the newest added still moves).
heres my Jquery script.
Anyone know what i've gotta do to get all 4 working ? Do i have to build them within the same script to ensure they don't roll over eachover and all move at the same time?
http://www.stay-linked.co.uk
Thats one working, just not sure why when i add more that it stops moving (and the newest added still moves).
heres my Jquery script.
Code:
<script>if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft">
<table border="0" width="135" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" style="background-image:url('http://www.stay-linked.co.uk/templates/joyfulgames/images/bar01.png')">
<p align="center"><b><font size="4">Menu</font></b></td>
</tr>
<tr>
<td width="100%" bgcolor="#cef1ff">
<?php include('./includes/modules/pages_vertical.php');?>
<?php echo $template['pages_menu_seperator'].'<a href="'.$setting['site_url'].'/index.php?task=contact">Contact us</a>';?>
</tr>
</table>
<!--END OF EDIT-->
</layer>
<script type="text/javascript">
var verticalpos="frombottom"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX = 20,
startY = 400;
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>
Anyone know what i've gotta do to get all 4 working ? Do i have to build them within the same script to ensure they don't roll over eachover and all move at the same time?