我正在尝试为内容区域添加一个非常微妙的反弹效果,在单击“。我猜它会在javascript中完成?
HTML
<div class="block">
<h2>This is green block is fixed</h2>
</div>
<div class="content" id="here">
<div class="headerbar"> <a href="#here">Top / Reveal</a>
Sublte Bounce
</div>
</div>
JS
$("a[href='#here']").click(function () {
$("html, body").animate({
scrollTop: $("body").scrollTop() == 0 ? 300 : 0
}, "slow");
return false;
});