悬停图像时是否可以隐藏标题? [英] Is it possible to hide title when hovering image?

查看:81
本文介绍了悬停图像时是否可以隐藏标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

<img src="image.jpg" alt="" title="some title" />

当我将鼠标悬停在图像上时,是否可以隐藏?

When I hover that image "some title" appears. Is it possible to be hidden?

推荐答案

它可以很容易做一些答案指出,但知道你想做什么与标题,我将使用一个data- *自定义属性或附加标题与.data()

It can be easily done as some answers point out, but knowing what you want to do with title, I would use a data-* custom attribute or attach the title with .data()

<img src="image.jpg" alt="" data-title="some title" />

$('img').data('title', 'some title');

这篇关于悬停图像时是否可以隐藏标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆