Author: dihola15 | Posted on: 5/17/2010 1:24:18 PM | Views : 371

Hi,
I have a div which I show when the user clicks on an image. To show this div I use some Javascript that positions the div just below the image, something like this:
function PositionRelative(sPositionElem, sRelativeTo, sParent, iLeftOffset, iTopOffset) {

    var PositionElem = GetDOM(sPositionElem);
    var RelativeTo = GetDOM(sRelativeTo);
    var Parent = GetDOM(sParent);
    
    // If PositionElem is hidden, show now
    if (PositionElem.style.display == 'none') {

        Show(sPositionElem);

        getPos(RelativeTo);
        PositionElem.style.left = RelativeTo.x + iLeftOffset;
        PositionElem.style.top = RelativeTo.y + iTopOffset;

   ...

Go to the complete details ...