From 8cd38dd3ed5d8ddd40fc497b1c9d0cf2c0aec5fd Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 6 Jun 2016 21:58:00 -0600 Subject: [PATCH] initial --- boxes.js | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/boxes.js b/boxes.js index 6b2b3db..8e7c8b9 100644 --- a/boxes.js +++ b/boxes.js @@ -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('Galvanize'); + $('a').click(function(event) { + alert('You can never leave the page!'); + event.preventDefault(); + }); + + var boxes = $('.box'); + var kitten = $('').css('display','none'); + boxes.append(kitten); + boxes.click(function() { + $(this).children('.kitten').toggle(); + }); + +});