Skip to content

Instantly share code, notes, and snippets.

@lutsen
Created March 23, 2017 15: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 lutsen/a58e2851beb32a2f66f44eea65e2f3e4 to your computer and use it in GitHub Desktop.
Save lutsen/a58e2851beb32a2f66f44eea65e2f3e4 to your computer and use it in GitHub Desktop.
Select elements at the same position in a different node with jQuery.
// Use index() to find the position and eq()to select a different element on the same position.
$(this).addClass('active');
$('.collage').eq( $(this).index() ).addClass('active');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment