当您将鼠标悬停在图像上时,我目前有以下代码可以在图像上添加叠加层:
<script>
function toggleOverlay(name, newState){
var element = 'imgOverlay' + name;
var newDisplay
if (newState == 0) {newDisplay = 'none'}
if (newState == 1) {newDisplay = 'block'}
document.getElementById(element).style.display = newDisplay;
//document.getElementById(element).style.z-index = '5';
}
function clearOverlays(){
toggleOverlay('SteBes',0);
toggleOverlay('VicGun',0);
toggleOverlay('SteFry',0);
toggleOverlay('DomSag',0);
toggleOverlay('DenCro',0);
//toggleOverlay('UnkOne',0);
//toggleOverlay('UnkTwo',0);
toggleOverlay('SteWoz',0);
}
</script>
我怎样才能淡入叠加层,因为它突然改变了?
谢谢。