A tweet-sized, fork-to-play, community-curated collection of JavaScript.
- Click the
button above to fork this gist.
- Modify all the files to according to the rules below.
- Save your entry and tweet it up!
All entries must exist in an index.js file, whose contents are
- a valid Javascript function expression, that
- optionally self-executes,
- contains no more than 140 bytes, and
- does not pollute global scope.
All entries must also be licensed under the MIT license.
The 140byt.es site hasn't launched yet, but for now follow @140bytes on Twitter.
To learn about byte-saving hacks for your own code, or to contribute what you've learned, head to the wiki.
140byt.es is brought to you by Jed Schmidt. It was inspired by work from Thomas Fuchs and Dustin Diaz.

Why not both in one function?
function(a,x,y){for(x=y=0;a;a=a.offsetParent)x+=(a.offsetLeft||0),y+=(a.offsetTop||0);return{left:x,top:y}}Anyway, the offset method is not very precise in some browsers (especially in Quirks mode). A better way to go (if available) is to use getBoundingClientRect, though this results in relative positions to the visible browser window.