JC wrote:
Hi,
Can someone send me a link where I can make the flip-down menu on this
page ?
Check the following script:
<URL:http://groups.google.fr/group/comp.lang.javascript/msg/6caa4b5950aae96c>
Edit the following three things:
- define "left:1%;top:1%" instead of "right:10%;top:10%",
- append "position:relative" inside "div#menu ul",
- substitute the setVisible function by the following one.
You can then adjust the step/interval parameters to your needs.
---
function setVisible(el,bVis){
var step=40;
var interval=10;
if(bVis){
el.style.display="";
el.style.left=(-(getAbsolutePosition(el).x+el.offsetWidth))+"px";
setTimeout(
function(){
var left=Math.min(0, parseInt(el.style.left)+step);
el.style.left=left+"px";
if(left!=0) {
setTimeout(arguments.callee, interval);
}
},
interval
);
}else
el.style.display="none";
function getAbsolutePosition(el){ // no borders, no overflows
var x=0, y=0;
do {
x+=el.offsetLeft|0;
y+=el.offsetTop|0;
el=el.offsetParent;
} while(el);
return {x:x,y:y};
}
}
---
HTH.