Skip to content

Instantly share code, notes, and snippets.

@Spesm
Created November 7, 2018 16:23
Show Gist options
  • Save Spesm/438c5dabb19230d5336616ba3031faf2 to your computer and use it in GitHub Desktop.
Save Spesm/438c5dabb19230d5336616ba3031faf2 to your computer and use it in GitHub Desktop.
// 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