当鼠标移到图像上方时,如何在文本上方显示文本 [英] How can I show text on top of my images when a mouse moves over them

查看:81
本文介绍了当鼠标移到图像上方时,如何在文本上方显示文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当鼠标移到图像上方时,如何在文本上方显示文本.

例如,您在youtube上看到缩略图上有一个添加到播放列表"按钮.我如何设置类似的按钮,但要设置类似的按钮.

我不是在寻找工具提示.我希望将鼠标悬停在文本上时在图像上显示文本.

How can I show text on top of my images when a mouse moves over them.

For example you see on youtube you have an add to playlist button on the thumbnails. How can I setup something similar but for a like button.

I am not looking for a tooltip. I want the text to shown on the image when the mouse is hovered over it.

推荐答案

您可以使用jquery来订阅鼠标悬停并留下事件,以及CSS为了显示文本,一种明显的方法是在鼠标悬停和离开时为图像设置css类
You can use jquery to subscribe to the mouse hover and leave events, and css to show text, the obvious way is to set the css class for your image as the mouse hovers and as it leaves


http://www. sitepoint.com/forums/showthread.php?845432-Mouse-Over-Text-To-Display-Image-On-A-Fixed-Location [ http://bytes.com/topic/javascript/answers/613362-display- text-mouse-over-images [ ^ ]
http://stackoverflow.com/questions/7003838/text-on-image-mouseover-like-youtube[^]
http://www.sitepoint.com/forums/showthread.php?845432-Mouse-Over-Text-To-Display-Image-On-A-Fixed-Location[^]
http://bytes.com/topic/javascript/answers/613362-display-text-mouse-over-images[^]


这篇关于当鼠标移到图像上方时,如何在文本上方显示文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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