Skip to content

Commit

Permalink
lightbox has an x
Browse files Browse the repository at this point in the history
  • Loading branch information
Danwhy committed May 22, 2015
1 parent 0b30719 commit d804866
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,18 @@
background: rgba(0,0,0,0.8);
}

#close {
position: fixed;
top: 50px;
left: 940px;
height: 50px;
width: 50px;
background-color: rgba(0,0,0,0);
background-image: url('../images/close.png');
background-repeat: no-repeat;
background-position: center center;
}

.picChild {
position: relative;
z-index: -1;
Expand Down
Binary file added images/close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions javascript/headers-callbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,16 @@ for (var i = 0; i < selectedPhotos.length; i++){
function lightbox(){
var darkness = document.createElement('div');
var lightbox = document.createElement('img');
var close = document.createElement('div');
close.setAttribute('id', 'close');
var fullSize = this.src.split('/');
fullSize.splice(5,1);
fullSize = fullSize.join('/');
lightbox.setAttribute('id', 'lightbox');
lightbox.setAttribute('src', fullSize);
filterpage.appendChild(darkness);
darkness.appendChild(lightbox);
darkness.appendChild(close);
darkness.setAttribute('class', 'darkened');
darkness.addEventListener('click', function(){
darkness.parentNode.removeChild(darkness);
Expand Down

0 comments on commit d804866

Please sign in to comment.