我需要隐藏图像,当我将鼠标放在应该可见的位置时,它就会出现。我该怎么做?
HTML:
<img onclick="stergeSertar(this)" onhover="arataX" src="img/x2.png" style="position: relative;aligh:center;z-index:600" class="xSertar" id="'+id+'xS">
JavaScript:
function arataX(x){
var idX=x.id+"xS";
$("#"+idX).toggleClass('active');
}
CSS:
.xSertar{
position:relative;
visibility:hidden;
margin-left=-10px;
}
.xSertar:hover{
position:relative;
margin-left=-10px;
visibility:visible;
}