Show text when the cursor hovers over an image

后端 未结 6 565
轮回少年
轮回少年 2021-01-03 02:45

I am trying to accomplish of the task of displaying text below an image when you hover over it. I do not want to use the title attribute, because I want to be a

6条回答
  •  别那么骄傲
    2021-01-03 03:39

    $(function() {
    
        $('.bar').css({opacity:0});
    
        $('.foo').hover(function() {
            $('.bar').stop().animate({
                opacity: 1
            },'fast');
        },function() {
            $('.bar').stop().animate({
                opacity: 0
            },'fast');
        });
    
    });
    

提交回复
热议问题