Created
November 7, 2018 16:23
-
-
Save Spesm/438c5dabb19230d5336616ba3031faf2 to your computer and use it in GitHub Desktop.
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
// Document ready exercise 2.9 | |
$(document).ready(function(){ | |
// $(".message-box").css("border", "2px solid red"); | |
// Work sections | |
for (var i = 0; i < works.length; ++i) { | |
$("#work").append("\ | |
<div class='col-6 col-md-4 col-lg-3'>\ | |
<a href='#' class='work-img'>\ | |
<img class='img-responsive' src='" + works[i].pic + "'>\ | |
<span class='info'><p class='proj-title'>Title:</p> works[i].title </span>\ | |
</a>\ | |
</div>\ | |
"); | |
var images = $ ("#work img"); | |
console.log (images[i]); | |
if (i % 2 === 0) { | |
$ (images[i]) .css ("border", "2px solid DodgerBlue"); | |
} else { | |
$ (images[i]) .css ("border", "2px solid salmon"); | |
}; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment