Created
March 23, 2017 15:18
-
-
Save lutsen/a58e2851beb32a2f66f44eea65e2f3e4 to your computer and use it in GitHub Desktop.
Select elements at the same position in a different node with jQuery.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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