如何在一个img上覆盖一个div,并显示另一个div onmouseover? [英] How do you overlay a div over an img, and show another div onmouseover?

查看:761
本文介绍了如何在一个img上覆盖一个div,并显示另一个div onmouseover?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表缩略图,点击时导致更大的同行。我想在缩略图底部的div中显示图片标题。此外,当鼠标移动到缩略图上时,它在整个事物上显示第二个div(包含文本)。

I have a list thumbnails that lead to larger counterparts when clicked. I'd like to show the image title in a div, at the bottom edge of the thumbnail. Also, when a mouse is moved over the thumbnail, it shows a 2nd div (containing text) over the entire thing.

这是最好的方法是什么?如果需要js库,则首选jquery。

Whats the best way of doing that? If a js library is required, jquery is preferred.

推荐答案

如果您准备好使用 jQuery ,这里是一个奇妙的帖子 Sam Dunn

If you are ready to go with jQuery then here is a fantastic post by Sam Dunn.

这篇关于如何在一个img上覆盖一个div,并显示另一个div onmouseover?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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