cgweaver
01-11-2006, 06:39 PM
I found a script which very simply reveals a div by id. but I can't get the location just right. It needs to be relative to the object that invokes it through mouseover. Take a look here (http://upcondos.com/CGW_Test/Suncrest.shtml), mouseover the 'Features' item on the far right. You'll see that I've got the vertical position worked out, although I don't like the way I did it (not dynamic enough), but the horizontal position varies with the width of the window; I want it to be constant relative to the object that invokes it.
Here's the script:
function showtip(current, whichDiv, whichParent)
{
if(document.getElementById)
{
elm=document.getElementById( whichDiv );
thisParent=document.getElementById( whichParent );
elml=current;
elm.style.top=parseInt(elml.offsetTop+(elml.offsetHeight*2));
elm.style.left=parseInt(elml.offsetLeft+elml.offsetWidth+345);
elm.style.visibility = "visible";
}
}
Thanks in advance. Any help will be greatly appreciated.
Here's the script:
function showtip(current, whichDiv, whichParent)
{
if(document.getElementById)
{
elm=document.getElementById( whichDiv );
thisParent=document.getElementById( whichParent );
elml=current;
elm.style.top=parseInt(elml.offsetTop+(elml.offsetHeight*2));
elm.style.left=parseInt(elml.offsetLeft+elml.offsetWidth+345);
elm.style.visibility = "visible";
}
}
Thanks in advance. Any help will be greatly appreciated.