Whe to put code for floating menu

For Joomla! 1.0 Coding related discussions.
Locked
dlgserver
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Nov 21, 2005 6:32 am

Whe to put code for floating menu

Post by dlgserver » Tue Nov 22, 2005 3:30 am

I have this script for a floating menu. Where should I put it. Thanks for helps.
_______

if (!document.layers)
document.write('')








Menu



Dynamic Drive
What's New
What's Hot
FAQs
More Zone









/*
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
*/

var verticalpos="frombottom"

if (!document.layers)
document.write('')

function JSFX_FloatTopDiv()
{
var startX = 3,
startY = 150;
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();

TSM
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Sun Nov 20, 2005 9:12 pm

Re: Whe to put code for floating menu

Post by TSM » Wed Nov 23, 2005 12:35 am

You could put it directly into the template calling a seperate js file with the js code to make the file a bit smaller.

If you want some control on the menu, you could build it into a module, which would also allow you to specify which pages you want it on or not.

dlgserver
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Nov 21, 2005 6:32 am

Re: Whe to put code for floating menu

Post by dlgserver » Wed Nov 23, 2005 1:03 am

Could you explain a little more in details?
I did this:
- make a float.js
- put it in root directory
- go to my template/tempaltesxyz/index.php
- insert this "
It must be that but it did not work!  :(
Could you help? Thanks


Locked

Return to “Joomla! 1.0 Coding”