TrialUser
asked on
placing a div exactly div below a td
I have an image inside a td. On mouse hovering the image, another div should show exactly below the td. It should not push the contents of the page down, instead just open it on op of the exisitng page contents. Please help me how I can position the div so that it is displayed excatly below the td. Thanks
I have attcahed the html and javascript that I have.
I have attcahed the html and javascript that I have.
function HideCart(id)
{
if (id.length < 1)
{
return;
}
document.getElementById(id).style.display = "none";
}
function ShowCart(id)
{
if (id.length < 1) {
return;
}
document.getElementById(id).style.display = "block";
}
<img src="Assets/Images/Master/shoppingcart.jpg"
style="height: 34px; width: 60px; " alt=' ' onmouseover="ShowCart('divCart')" onmouseout="HideCart('divCart');" />
<div id="divCart" style="display:none; position:absolute; border-style: solid; background-color: #E5E5E5; height: 4px; padding: 5px;" class="search">
ctent here</div>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get the ele2 as null. I even tried to pass the element id to the javascript but still it shows null.
Please help
"ShowCart('tdShoppingCart'
function ShowCart(idTD,id)
{
if (id.length < 1)
{
return;
}
var objTD = document.getElementById(id
alert(objTD);
var objCart = document.getElementById(id
alert(objCart);
objCart.Style.Display = "block";
objCart.style.top = objTD.style.top + objTD.style.height;
}