Vis*_*ish 2 javascript jquery image
我试图做一个效果,当鼠标悬停在图像上时,它会变大50%的大小,并在鼠标移出其区域后立即返回.用jquery可以做到这一点吗?怎么样?没有jquery可以做到这一点吗?如果没有jquery,这有多难?
Šim*_*das 16
干得好:
$('img').load(function() {
$(this).data('height', this.height);
}).bind('mouseenter mouseleave', function(e) {
$(this).stop().animate({
height: $(this).data('height') * (e.type === 'mouseenter' ? 1.5 : 1)
});
});
Run Code Online (Sandbox Code Playgroud)
现场演示: http ://jsfiddle.net/simevidas/fwUMx/5/
| 归档时间: |
|
| 查看次数: |
19998 次 |
| 最近记录: |