【发布时间】:2014-05-04 03:08:46
【问题描述】:
我的代码中有一个 div,我在其中插入了一张图片。我希望当我将鼠标悬停在该图像上时,应该在图像上显示一个带有一些文本的框.....
<div id=".image">
<img src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSZPFUnMbNKcDHYgjgLqslZtOicCfxph__Jwk95NZGXM_HZ1wzvbGhlrSNi">
<div id="des">hi</div>
</div>
当鼠标悬停在图像上方时,我想在图像顶部制作一个带有一些文本的框。
我该怎么做?
我试过了,但没用
<script type="text/javascript">
$(document).ready(function(){
$(".image").mouseover(function() {
alert("hello");
$(this).children(".des").show();
}).mouseout(function() {
$(this).children(".des").hide();
});
});
</script>
【问题讨论】:
-
有很多答案。
-
搜索,搜索,搜索!!!
标签: javascript jquery html css