如何防止将鼠标悬停在图像上时出现替代文本?
我尝试添加 title="" 但当我将鼠标悬停在 FF 和 Safari 中的照片上时,我的替代文本仍然出现...
我还可以尝试其他方法吗?
这是我的示例页面:
http://ianmartinphotography.com/test-site/wedding-01/< /a>
谢谢!
I've tried adding title="" but my alt text still appears when I hover over the photos in FF and Safari...
Anything else I can try?
Here's my example page:
http://ianmartinphotography.com/test-site/wedding-01/
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您必须影响 ALT 标签,而不是标题。
您的图片标签如下所示:
这就是给您带来麻烦的原因:
title="" alt="新娘准备好参加黑白婚礼。"
或者也许会说;这就是让您获得完全预期结果的原因!
You have to affect the ALT tag, not title.
Your image tag looks like this:
This is what cause you trouble:
title="" alt="Bride ready for wedding in black and white."
Or perhaps saying; That's what cause you an fully expected result!
导致您出现问题的不是
alt
属性。其内容如下:图像位于锚点内,链接具有显示的
title
属性。It is not the
alt
attribute what causes your problem. It is the following:Images are inside anchors, and the links get a
title
attribute which gets shown.我假设它与您用于“显示框”的 jQuery 有关,也许可以阅读自述文件或其他内容。
但是,我在您的代码中注意到了这一点
为什么您有
?没有需要关闭的超链接。
更新
查看您的代码后,我发现了这一行
(位于 http://ianmartinphotography .com/test-site/wedding-01/js/slideshow.js)
尝试删除
(img.get('alt'),
看看是否有帮助I'm assuming it's related to the jQuery your using for the "display box", perhaps read over the readme or something.
However, I noticed this in your code
Why do you have
</a>
? There is no hyperlink that needs to be closed.Update
After looking over your code I found this line
(located in http://ianmartinphotography.com/test-site/wedding-01/js/slideshow.js)
Try removing
(img.get('alt'),
see if that helps好的!我的错 - 我正在使用 Mootools Slideshow2 http://code.google.com/p/slideshow/
该节目默认打开标题,它将替代文本转换为标题。我只是将 Slideshow.js 中的标题从“true”更改为“false”,问题就解决了。我觉得有点傻,我应该马上想到这一点。感谢大家的关注!
Okay! My bad--I'm using Mootools Slideshow2 http://code.google.com/p/slideshow/
The show defaults to having titles on, it converts alt text into titles. I simply changed titles from "true" to "false" in slideshow.js and the problem is solved. I feel a bit silly, I should have thought of that right away. Thanks for your attention everyone!