【发布时间】:2011-05-25 00:15:46
【问题描述】:
我在网站上使用流沙插件,我想让所有项目都具有悬停效果。我设法做到了,但是在过滤发生后悬停效果会消失。然后我遵循了这个建议:
jQuery quicksand plugin with .click method
并将以下内容添加到我的代码中:
$("img.on").live({
mouseover:
function() {
$(this).stop().animate({"opacity": "0"}, "slow");},
mouseout:
function() {
$(this).stop().animate({"opacity": "1"}, "slow");}});
$("img.over").live({
mouseover:
function() {
$(this).stop().animate({"opacity": "1"}, "slow");},
mouseout:
function() {
$(this).stop().animate({"opacity": "0"}, "slow");}});
在 ff 上似乎可以正常工作,但 ie8 无法正常工作。悬停图像出现在原始图像上方并且不会从那里移动。如果我将 mouseover 更改为 mouseenter 并将 mousout 更改为 mouseleave 它至少会在悬停并离开后淡出然后按预期执行。
我通过 css 将悬停 img 的不透明度转换为 cero。
我可能犯了一个新手错误,我对 js 和 jquery 完全陌生。
【问题讨论】:
-
天哪! 流沙是产品名称吗?
标签: javascript jquery hover quicksand