diff --git a/boxes.js b/boxes.js index 6b2b3db..395be83 100644 --- a/boxes.js +++ b/boxes.js @@ -1 +1,46 @@ -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'); + // }); + +// last one + // $('#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