Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions boxes.js
Original file line number Diff line number Diff line change
@@ -1 +1,53 @@
"use strict";

console.log("hello world");

$('document').ready(function () {

//Exercise 1

// var secretBox = $("#secretBox");
// secretBox.css('backgroundColor','white');
// secretBox.html('Secret Box!');
//
// var firstRow = $('#row1');
// firstRow.children().removeClass().addClass('box boxType3');
//
// var lastRow = $('#container').children().last();
// var veryLast = lastRow.children().last();
// veryLast.css('display','none');
//
// var redBoxes = $('.boxType1');
// redBoxes.css('backgroundColor','white');
//
// var secondRow1 = $('#row2').children()[0];
// secondRow1.className = '';
//
// var secondRow2 = $('#row2').children()[1];
// secondRow2.className = '';
//
// var notSecret = $('.box:not(#secretBox)');
// notSecret.css('width','2px');

//Exercise 2

var container = $('#container');
container.click(function(event) {
console.log(event.clientX + ',' + event.clientY);
});

var redBoxes = $('.boxType1');
redBoxes.html('<a href="http://galvanize.com">Galvanize</a>');
$('a').click(function(event) {
alert('You can never leave the page!');
event.preventDefault();
});

var boxes = $('.box');
var kitten = $('<img class="kitten" src="http://placekitten.com/100/100">').css('display','none');
boxes.append(kitten);
boxes.click(function() {
$(this).children('.kitten').toggle();
});

});