当鼠标悬停在jquery上时,图像不会变得不透明
Image wont become non-opaque when hovered over jquery
我需要这两个图像在悬停时淡入,在未悬停时淡出。我找了好几个小时了,但什么都没找到。
个人简历:
<script>
$(document).ready(function(){
$("#tut_select").mouseenter(function(){
$(".tut_select").css("opacity","1");
});
$("#tut_select").mouseleave(function(){
$(".tut_select").css("opacity",".8");
});
});
</script>
页面:http://pinkpencil.x10.mx/tutorials.php
这里有一个小提琴:http://jsfiddle.net/PinkPencil/TwyE8/
如果没有绝对的理由使用jQuery,为什么不使用一些CSS呢?
的例子:
img.tut_select {
opacity: 1;
-moz-transition: opacity .25s ease-in-out;
-webkit-transition: opacity .25s ease-in-out;
-o-transition: opacity .25s ease-in-out;
transition: opacity .25s ease-in-out;
}
img.tut_select:hover {
opacity: .8;
}
试试这个:
HTML<div class="wrap">
<img class="tut_select" src="./images/desktop.png">
</div>
CSS .wrap { opacity:0 }
.wrap:hover { opacity:1 }
相关文章:
- 将多个重叠的透明图像保存为一个图像
- 使用send时,jquery文件上传不调整图像客户端的大小
- jQuery透明图像描述鼠标悬停时的幻灯片动画
- 为什么innerHTML不更改图像的src
- 预加载标签IMG而不指定图像的名称
- JavaScript 在删除预上传图像时不清除图像数组
- 锤击JS平移不移动图像
- 添加此共享按钮不显示图像
- Javascript RegEx匹配URL's,但不包括图像
- 可以'尽管上传成功,但在aws3中找不到图像
- JSPDF输出()不显示图像
- 如果浏览器不显示图像,如何显示图像;不支持HTML 5 Canvas
- Firefox断开页面;不显示图像或CSS样式
- 列表项中的滚动效果(不在图像上)
- 使用jQuery的透明图像背景
- JSXGraph 中有什么方法可以使图像不透明
- 当鼠标悬停在jquery上时,图像不会变得不透明
- 当单选按钮被选中时,图像不透明,但需要隐藏实际的按钮
- 在画布上绘制不透明图像
- 只有当所单击的像素不透明时,才会在图像上注册事件