From 093cbd21b4315d65f9f2f985a058ba77ffb984b5 Mon Sep 17 00:00:00 2001 From: Mike Homolak Date: Thu, 18 Feb 2016 06:39:05 -0800 Subject: [PATCH 1/2] completed --- boxes.js | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/boxes.js b/boxes.js index 6b2b3db..65facf5 100644 --- a/boxes.js +++ b/boxes.js @@ -1 +1,46 @@ -console.log("hello world"); +// $( document ).ready(function() { +// alert("Ready for DOM manipulation."); +// }); +$(function() { + alert("Ready for DOM manipulation."); + $("#secretBox").css({'background': 'white'}); + + // var $div = $('
', { + // 'id':'secretBox' + // }).appendTo('#secretBox'); + // $("

").text("secret box!").appendTo($div); + // + // $("#row1").addClass("boxType3"); + // + // $("#row4 :last-child").hide(); + // + // $(".boxType1").css({'background': 'white'}); + // + // $("#row2 :nth-child(-n+2)").css({'background': 'transparent'}); + // + // $('.box:not(div#secretBox)').width('2px') + + $("#container").on('click', function(e) { + console.log(e.pageX, e.pageY); + }); + + $(".boxType1").on('click', function() { + $(".boxType1").wrap(''); + alert("You can never leave this page!"); + event.preventDefault(); + }); + + $('.box').on('click', function() { + $(this).css({'background-image': 'url(https://pbs.twimg.com/profile_images/562466745340817408/_nIu8KHX.jpeg)'}); + }) + + $(function(){ + $('#container').on('click', function(event){ + $(this).css({'background-color': 'black'}) + $(event.target).css({'background-color': 'white'}) + if (event.target == this) { + $(this).css({'background-color': 'rgb(50, 255, 46)'}) + } + }) + }) +}); From dba73d216d7a6d71b60debb87333c47409ae5a5a Mon Sep 17 00:00:00 2001 From: Mike Homolak Date: Thu, 18 Feb 2016 06:39:38 -0800 Subject: [PATCH 2/2] removed // --- boxes.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/boxes.js b/boxes.js index 65facf5..b43ab96 100644 --- a/boxes.js +++ b/boxes.js @@ -1,24 +1,24 @@ -// $( document ).ready(function() { -// alert("Ready for DOM manipulation."); -// }); +$( document ).ready(function() { + alert("Ready for DOM manipulation."); +}); $(function() { alert("Ready for DOM manipulation."); $("#secretBox").css({'background': 'white'}); - // var $div = $('
', { - // 'id':'secretBox' - // }).appendTo('#secretBox'); - // $("

").text("secret box!").appendTo($div); - // - // $("#row1").addClass("boxType3"); - // - // $("#row4 :last-child").hide(); - // - // $(".boxType1").css({'background': 'white'}); - // - // $("#row2 :nth-child(-n+2)").css({'background': 'transparent'}); - // - // $('.box:not(div#secretBox)').width('2px') + var $div = $('
', { + 'id':'secretBox' + }).appendTo('#secretBox'); + $("

").text("secret box!").appendTo($div); + + $("#row1").addClass("boxType3"); + + $("#row4 :last-child").hide(); + + $(".boxType1").css({'background': 'white'}); + + $("#row2 :nth-child(-n+2)").css({'background': 'transparent'}); + + $('.box:not(div#secretBox)').width('2px') $("#container").on('click', function(e) { console.log(e.pageX, e.pageY);