|
Use relative position, just position it relative to your logo.
code show as below:
function GetRelated(element,attribute)
{
The
if (arguments.length != 2 || element == null)
{
return null;
}
var elmt = element;
var offsetTop = elmt.offsetTop;
var offsetLeft = elmt.offsetLeft;
The
while( elmt.offsetParent) {
elmt = elmt.offsetParent
offsetTop += elmt.offsetTop;
offsetLeft += elmt.offsetLeft;
}
if( attribute =='top') return offsetTop;
else if( attribute =='left') return offsetLeft;
else return 0;
} |
|