我怎么说,使用 jQuery 将元素从其初始位置向一侧滑动几个像素?我知道有一个 animate() 函数,但我不知道如何使用它。提示,教程将不胜感激。
编辑:
我现在正在尝试在鼠标悬停时更改元素的背景颜色(我也想最终交换背景图像,但现在不是......)
我目前正在使用以下代码。怎么了?(.link 是一个引用一堆元素的类)
//light up links on mouseover
$(".link").mouseover(function(event){
$(this).animate({'color' : '#000099'}, "fast");
});
//dim link on mouseout
$(".link").mouseout(function(event){
$(this).animate({'color' : '#efefef'}, "fast");
});