【发布时间】:2015-05-10 10:31:50
【问题描述】:
如果 jQuery 反弹效果应用于具有 box-sizing:border-box 和一些填充的 div,则在效果动画期间它会缩小其填充大小。见here。
HTML
<div class="test">
This is test div to bounce!
</div>
CSS
.test {
box-sizing: border-box;
min-height: 100px;
width: 250px;
background-color: #435ff3;
text-align: center;
cursor: pointer;
padding: 50px;
}
JavaScript
$('.test').click(function() {
$(this).effect('bounce', { distance : 10, times: 2 }, 'slow');
});
谁能解释一下这个现象?
【问题讨论】:
标签: jquery css jquery-ui padding