Skip to content

Instantly share code, notes, and snippets.

// e.g. scrollToTarget(document.getElementById('foo'));
function getOffset(target){
var offset = {};
function getOrdinate(offsetType){
var ord = 0;
while (target && target !== document.body){
if (target[offsetType]){
ord += target[offsetType];
@maskingtape
maskingtape / dabblet.css
Created March 7, 2012 13:02 — forked from LeaVerou/dabblet.css
Move in a circle without wrapper elements
/**
* Move in a circle without wrapper elements
* Idea by Aryeh Gregor, simplified by Lea Verou
*/
@keyframes rot {
from {
transform: rotate(0deg)
translate(-150px)
rotate(0deg);