Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions boxes.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@
<div class="box boxType3"></div>
<div class="box boxType1"></div>
</div>
<!-- <div style="z-index: 4; width: 100px; height: 100px; background-color: purple; position: absolute; top: 0 ; left : 0" id="purple_box">
purple box
</div> -->
</div>


</body>

</html>
54 changes: 53 additions & 1 deletion boxes.js
Original file line number Diff line number Diff line change
@@ -1 +1,53 @@
console.log("hello world");
$( document ).ready(function() {


// // Exercise #2 - Commented Out for Events in Exercise #3
// $(document).find('#secretBox').css('background-color', 'white');
// $(document).find('#secretBox').html('<h1>Secret box!</h1>');
//
// $('#row1').children().attr('class', 'boxType3');
//
// $('#row4 div:last-child').css('display', 'none');
//
// $('.boxType1').css('background-color', "white");
//
// $('#row2 div:nth-child(-n+2)').attr('class', '');
//
//
// $("#container div").not('.row').not('#secretBox').css('width', '2px');

//Exercise #3 -
//
// $('#container').on('click', function(event){
// console.log(event.pageX, event.pageY);
// })
//
$('.boxType1').not('#secretBox').html('<a id="forever" href="http://www.galvanize.com">ClickHere!</a>');

$('.boxType1 a').on('click', function(event){
alert('HAHAHA you can never leave this page ever!');
event.preventDefault();
});

// $('.box').append('<img class="togglePup" src="https://s-media-cache-ak0.pinimg.com/736x/dd/59/a2/dd59a2d7fce53a8cf08b792377b9dbe9.jpg"' + '/>');
// $('.togglePup').css('max-height', '100%');
// $(".togglePup").hide();
//
// $(".box").on('click', function(){
// $(this).children().toggle();
// });
//
// $("#container").on('click', function(e){
// if (e.target.id === 'container') {
// $(this).css('background-color', "lightgreen");
// } else {
// console.log(e.target);
// console.log('^^^');
// $(e.target).css('background-color', 'white');
// $('#container').css('background-color', 'black');
// }
//
// })


});