Is it possible to hide title when hovering image?

后端 未结 8 908
长情又很酷
长情又很酷 2020-12-21 18:30

This is my code:

\"\"

When I hover that image \"some title\" appears. Is it possib

8条回答
  •  死守一世寂寞
    2020-12-21 18:47

    You can move it to image data... and back. Like that

    $('img').hover(
      function () {
        $(this).data('title',$(this).attr('title')).removeAttr('title');
      }, 
      function () {
        $(this).attr('title',$(this).data('title'));
      }
    );
    

提交回复
热议问题