鼠标经过图片显示文字,鼠标移除时文字隐藏

<script>    

  $(".ygty_col").mouseover(function(){ 
  $(this).children(".smallhover").show();
});

  $(".ygty_col").mouseout(function(){    
  $(this).children(".smallhover").hide();   
});

 
</script>

<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>

前提是需要引用jQuery文件:

鼠标经过class名为ygty_col时,它的子辈class名为smallhover时显示;

鼠标移除时class名为ygty_col时,它的子辈class名为smallhover时隐藏;

根据需要可调整smallhover的大小

原文地址:https://www.cnblogs.com/wangbei2016/p/5370960.html