Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用jquery延迟背景效果?_Jquery - Fatal编程技术网

用jquery延迟背景效果?

用jquery延迟背景效果?,jquery,Jquery,我试图更改一些div悬停时的背景,但由于某些原因,我无法使用jquery。 我想要的是提供一个从图像到悬停图像的效果,因为使用css的变化太快,看起来一点也不好。 有什么建议吗? 这是我的密码 #siman{ background: url(images/siman.png) left top no-repeat; } #vogue{ background: url(images/vogue.png) top left no-repeat; } #consejo{ bac

我试图更改一些div悬停时的背景,但由于某些原因,我无法使用jquery。 我想要的是提供一个从图像到悬停图像的效果,因为使用css的变化太快,看起来一点也不好。 有什么建议吗? 这是我的密码

#siman{
    background: url(images/siman.png) left top no-repeat;
}
#vogue{
    background: url(images/vogue.png) top left no-repeat;
}
#consejo{
    background: url(images/consejodelcafe.png) top left no-repeat;
}
#digicel{
    background: url(images/digicel.png) top left no-repeat;
}
#siman:hover, #vogue:hover, #consejo:hover, #digicel:hover{
    background-position: left -96px
}

你不能使用动画功能吗

您在图像上附加了一个悬停侦听器,在悬停时,您的函数会执行此操作

$(this).css('background-position', '0px 0px');
$(this).animate({

  'background-position-x': '-96px',
}, 10000, 'linear');

这就是你要找的吗?所以,我的代码应该是这样的:$siman.hover函数{$this.animate{'background-position-x':'-96px',},10000,'linear';};对不起,我对jquery太陌生了!