From 1f3a31766ae4790b629a77f03b18e32c3984f796 Mon Sep 17 00:00:00 2001 From: Harrison Fischberg Date: Fri, 19 Feb 2016 15:26:40 -0700 Subject: [PATCH 1/2] done --- boxes.js | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/boxes.js b/boxes.js index 6b2b3db..df75103 100644 --- a/boxes.js +++ b/boxes.js @@ -1 +1,48 @@ -console.log("hello world"); +// // Exercise 1,2 +// $(function() { +// // alert("Ready for DOM manipulation, baby."); +// $("#secretBox").css("background-color","white").append("

secret box!

") +// $('#row4 div:last-child').css("display", "none"); +// $('.boxType1').css("background-color","white"); +// $('#row2 div:eq(0)').css("background","none"); +// $('#row2 div:eq(1)').css("background","none"); +// //$('#row2 div:nth-last-child(n+3)').css("background","none"); +// $('#row1').children().attr("class","box boxType3"); +// $("div").not(".row, #secretBox, #container").css("width", "2px"); +// }); + +// console.log("hello world"); + +// Events, exercise 3 +// $(function(){ +// $('#container').on('click', function(e){ +// var offset = $(this).offset(); +// console.log(e.pageX - offset.left); +// console.log(e.pageY - offset.top); +// }); + // $('.boxType1').on('click', function(){ + // window.location = 'http://www.galvanize.com'; + // }); + // $('.boxType1').on('click',function(){ + // window.stop(); + // alert("DON'T GO ANY FURTHER. GALVANIZE IS BLOCKED PUNK!") + // }); + // $('.box').append('') + // $('.box').on('mouseup', function(){ + // $(this).children().toggle('slow'); + // }); + + // ternary operator + // $(event.target).hasClass('box') ? $(event.target).css("background-color","white") : $(event.target).css("background-color","limegreen") + + // $('#container').on('click', function(e){ + // $(this).css("background-color","black"); + // var + + // if ($(e.target).hasClass('box')){ + // $(e.target).css("background-color","white"); + // } else { + // $(e.target).css("background-color","limegreen"); + // } + // }); +// }); \ No newline at end of file From e971bbe80acccb9f21abc25292bd288919e13519 Mon Sep 17 00:00:00 2001 From: Harrison Fischberg Date: Fri, 19 Feb 2016 15:27:56 -0700 Subject: [PATCH 2/2] mistake --- boxes.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/boxes.js b/boxes.js index df75103..395be83 100644 --- a/boxes.js +++ b/boxes.js @@ -1,15 +1,15 @@ // // Exercise 1,2 -// $(function() { -// // alert("Ready for DOM manipulation, baby."); -// $("#secretBox").css("background-color","white").append("

secret box!

") -// $('#row4 div:last-child').css("display", "none"); -// $('.boxType1').css("background-color","white"); -// $('#row2 div:eq(0)').css("background","none"); -// $('#row2 div:eq(1)').css("background","none"); -// //$('#row2 div:nth-last-child(n+3)').css("background","none"); -// $('#row1').children().attr("class","box boxType3"); -// $("div").not(".row, #secretBox, #container").css("width", "2px"); -// }); +$(function() { + // alert("Ready for DOM manipulation, baby."); + $("#secretBox").css("background-color","white").append("

secret box!

") + $('#row4 div:last-child').css("display", "none"); + $('.boxType1').css("background-color","white"); + $('#row2 div:eq(0)').css("background","none"); + $('#row2 div:eq(1)').css("background","none"); + //$('#row2 div:nth-last-child(n+3)').css("background","none"); + $('#row1').children().attr("class","box boxType3"); + $("div").not(".row, #secretBox, #container").css("width", "2px"); +}); // console.log("hello world"); @@ -32,9 +32,7 @@ // $(this).children().toggle('slow'); // }); - // ternary operator - // $(event.target).hasClass('box') ? $(event.target).css("background-color","white") : $(event.target).css("background-color","limegreen") - +// last one // $('#container').on('click', function(e){ // $(this).css("background-color","black"); // var