Created
October 13, 2016 20:28
-
-
Save kajatiger/8a6d6a58f8acf2b7bd1847196d6b6bb3 to your computer and use it in GitHub Desktop.
iterating through every second img with modulus for even numbers
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
// work section | |
for(var i = 0; i < works.length; ++i ) { | |
$('#work').append('\ | |
<div class="col-xs-6 col-md-3"> \ | |
<img src="' + works[i] + '" class="img-responsive"> \ | |
</div> \ | |
'); | |
var images = $('#work img'); | |
if (i%2 === 0) { | |
$(images[i]).css("border", "2px solid DodgerBlue"); | |
} else { | |
$(images[i]).css("border", "2px solid salmon"); | |
}; |
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
var works = [ | |
"img/ediblehoodhome.jpg", | |
"img/aboutediblehood.jpg", | |
"img/locations.jpg", | |
"img/addlocation.jpg", | |
"img/pumpkinediblehood.jpg", | |
"img/aboutkaja.jpg", | |
"img/magicofcoding.png", | |
"img/working.jpg", | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment