Skip to content

Instantly share code, notes, and snippets.

@caillou
Created April 19, 2014 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caillou/11077724 to your computer and use it in GitHub Desktop.
Save caillou/11077724 to your computer and use it in GitHub Desktop.
Naturally Aligned
// I love the fact that my code aligns perfectly due to the fact that ...
console.log('top|bottom'.length === 'left|right'.length);
// ... returns true.
$overlay.data('region', region)
.css({
top: (region === 'bottom') ? '50%' : 0,
bottom: (region === 'top') ? '50%' : 0,
left: (region === 'right') ? '50%' : 0,
right: (region === 'left') ? '50%' : 0
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment