guymclaren
12-08-2004, 07:53 AM
Can some one explain this to me and also how I could modify the positioning based on this or a variant thereof please.
I need to know what this is doing line by line and how to move the drop down say 65 pixels left and 85 pixels up. This is from the Drop down menu script.
function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
I need to know what this is doing line by line and how to move the drop down say 65 pixels left and 85 pixels up. This is from the Drop down menu script.
function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}