Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's not a shake effect, but a scroll effect (jQ scroll-to plug-in). The appearance of shake occurs because the scroll rate is higher than your browser can render smoothly.

The site uses a paginated, single-page model with sections styled with significant design differences for each "page". When clicking a link (they're not actually links [boooo!]), a JS scroll event is triggered. Some relatively straight-forward tweaks could fix this.

The author uses span tags to wrap elements that act like links. A far more appropriate markup would use an anchor tag with a fragment identifier (#fragment-id). The span tags that are currently in use use class names to identify the "location" of the target. This is, again, poor form. A URL is the tool for specifying location, and URLs are linked using the anchor tag.

HTML Excerpt 1:

<div class="wrap"> <span class="scroll_to_text">Text Scope</span> <p>Compare text and source code.</p> </div>

Change to:

<div class="wrap"> <a href="#text">Text Scope</a> <p>Compare text and source code.</p> </div>

JS Excerpt 1:

$(".scroll_to_text").click(function() {$.scrollTo($("#text").position().top-40, 300)});

Change to:

$("#text").click(function(event) {$.scrollTo($("body").position().top, 300);event.preventDefault();});

I'm a novice HTML/Javascript guy at best, so the code above may not function correctly in production, but I'm certain that the principle is appropriate.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: