javascript - how to make a div appear on hover and disappear on hover out? -
hi first of code -
<script> function slide() { if(document.getelementbyid('eiv').classname == 'deactive') { document.getelementbyid('eiv' ).classname = 'active'; document.getelementbyid('eiv').style.webkittransition ='all 0.5s'; } else { document.getelementbyid("eiv").classname = 'deactive'; document.getelementbyid('eiv').style.webkittransition ='all 0.5s'; } } function slideout() { if(document.getelementbyid('eiv').classname == 'active') { document.getelementbyid('eiv' ).classname = 'deactive'; document.getelementbyid('eiv').style.webkittransition ='all 0.5s'; } else { document.getelementbyid("eiv").classname = 'active'; document.getelementbyid('eiv').style.webkittransition ='all 0.5s'; } } </script> <body> <span id="container"><div id="colo" onmouseover="slide()" onmouseout="slideout()">lololol</div> </body>
i made div id eiv slides on left side on hover of colo , slides out on mouseout colo , fine want after making appear should stay there when mouseover on eiv , slide out on mouseout eiv( when eiv slides in overlap colo) , when again mouse in on colo eiv appears
this charmsbar in windows 8
you can't that, because if div become hide, never trigger hover event.
so suggest change of color div same color of background-color of site or change transparent.
.visiblediv{ background-color:yellow; height:100px; display:block; } .visiblediv:hover{ background-color:white; height:100px; display:block; }
see example
Comments
Post a Comment