I am creating a page on which I have several div's. They contain an image as background.
When I do a mouseover on a div, I want a div (with an image semitransparant), to be placed ontop of it's hovered div. When mouseout the semitransparant div should be hidden.
Now I have the following code, it does work, but sometimes on mouseout the semitransparant div isn't hidden (when the mouse moves to quick). Is there a solution for it?
PHP Code:
echo '<div id="block-'.$BlockNums.'" class="blok '.$BlockStyle.'" onmouseover="document.getElementById(\'message\').style.display=\'block\';" ><img src="images/'.$BlockImg.'.png" width="181"/></div>';
echo '<a href="'.$BlockLink.'" style="display:block;cursor:pointer;"><div id="message" class="disMessage" style="display:none;" onmouseout="document.getElementById(\'message\').style.display=\'none\';"><p>'.$BlockMouse.'</p></div></a>';
And the css:
Code:
.disMessage
{
width: 163px;
height: 168px;
z-index: 1000;
position: absolute;
padding: 10px 10px 10px 10px;
text-align: center;
background-image: url("../images/hoverTrans.png");
}
.blok
{
width: 181px;
height: 186px;
/*border: 1px solid #FE7701;*/
background-image: url("../images/blok.png");
padding: 1px 9px 9px 1px;
}
Thanks