根据CSS3里面的动画属性,结合Jquery实现简单的图片特效
html代码
js代码
// 鼠标放在图片上图片上下跳动
$('.operative-area>img').mouseover(function(){
$(this).animate({"top":"-10"});
}).mouseout(function(){
$(this).animate({"top":"0"});
})
结果
鼠标放上去:
鼠标移走之后,图片回到原来的位置
根据CSS3里面的动画属性,结合Jquery实现简单的图片特效
html代码
js代码
// 鼠标放在图片上图片上下跳动
$('.operative-area>img').mouseover(function(){
$(this).animate({"top":"-10"});
}).mouseout(function(){
$(this).animate({"top":"0"});
})
结果
鼠标放上去:
鼠标移走之后,图片回到原来的位置