Skip to content

Instantly share code, notes, and snippets.

@iamchristough
Last active February 14, 2019 10:50
Show Gist options
  • Save iamchristough/61fde2fdf277dbd228d851f87ab33136 to your computer and use it in GitHub Desktop.
Save iamchristough/61fde2fdf277dbd228d851f87ab33136 to your computer and use it in GitHub Desktop.
Map elements and elements default positions to an array
const imgs = [...document.querySelectorAll('.content__img')];
const imgsTotal = imgs.length;
let imgTranslations = [...new Array(imgsTotal)].map(() => ({x: 0, y: 0}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment