我是一个新手j查询和我有这个网站,我与前一段时间建立了闪存。现在我想用j Query来做出同样的效果。请在下面的URL中查看效果。Jquery on Hover Bounc and Ease
我尝试过的一些事情看下面的代码,但东西是不正确的,不光滑,每一次我悬停在任何圆的时候,我得到萤火虫的控制台上的错误。请指点队友,感谢
<div class="circle floatleft" id="circle1"><p>Circle One</p></div>
<div class="circle floatleft" id="circle2"><p>Circle two</p></div>
<div class="circle floatleft" id="circle3"><p>Circle three</p></div>
<div class="circle floatleft" id="circle4"><p>Circle four</p></div>
我对演示目的
.circle{border-radius: 50%;border: 5px solid #FFBD00;background:#4679BD;color:#fff;text-align:center;margin:auto;vertical-align:middle;padding:20px;min-width:100px;min-height:100px;}
.floatleft一些简单的CSS {浮动:左;} .circle> p {垂直对齐:中间;保证金:汽车;文本对齐:中心;}
的,我是用
$(".circle").hover(function() {
//resize other circles
var circleHeight = $(".circle").height();
var circleWidth = $(".circle").width();
$(".circle").animate({'opacity' : '0.5', 'height' : circleHeight/4, 'width' : circleWidth/4});
var $this = $(this);
$this.animate({
'height': $this.height() * 1.2,
'width' : $this.width() * 1.2,
'opacity' : '1'
});
},function() {
$(".circle").animate({'opacity' : '1', 'height' : circleHeight * 4, 'width' : circleWidth * 4});
var $this = $(this);
$this.animate({
'height': $this.height()/1.2,
'width' : $this.width()/1.2
});
});