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
Binary file modified assets/touchTouch/arrows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions assets/touchTouch/touchTouch.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

/* Arrows */

#prevArrow,#nextArrow{
#prevArrow,#nextArrow,#closeButton{
border:none;
text-decoration:none;
background:url('arrows.png') no-repeat;
Expand All @@ -124,7 +124,7 @@
transition:opacity 0.2s ease;
}

#prevArrow:hover, #nextArrow:hover{
#prevArrow:hover, #nextArrow:hover, #closeButton:hover{
opacity:1;
}

Expand All @@ -137,3 +137,12 @@
background-position:right top;
right:40px;
}

/* Enable the close button by overriding #closeButton{top:NNNpx;} in your css. Try
* 100px as a first guess if you're not sure where to position the close button.
*/
#closeButton{
background-position:-43px 0px;
top:-1000px;
right:43px;
}
14 changes: 12 additions & 2 deletions assets/touchTouch/touchTouch.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
slider = $('<div id="gallerySlider">'),
prevArrow = $('<a id="prevArrow"></a>'),
nextArrow = $('<a id="nextArrow"></a>'),
closeButton = $('<a id="closeButton"></a>'), // optional, enable in CSS.
overlayVisible = false;


Expand Down Expand Up @@ -120,9 +121,9 @@
//Filter to check if item has an ancestory with data-gallery attribute
items = items.filter(function(){

return $(this).parent().closest('[data-gallery]').length;
return $(this).parent().closest('[data-gallery]').length;

});
});

}

Expand Down Expand Up @@ -154,6 +155,12 @@
e.preventDefault();
showNext();
});

overlay.append(closeButton);
closeButton.click(function(e){
e.preventDefault();
hideOverlay();
});
}

// Listen for arrow keys
Expand Down Expand Up @@ -196,6 +203,7 @@

// Raise the visible flag
overlayVisible = true;
return true;
}

function hideOverlay(){
Expand All @@ -214,6 +222,7 @@

//Reset possibly filtered items
items = allitems;
return true;
}

function offsetSlider(index){
Expand Down Expand Up @@ -242,6 +251,7 @@
loadImage(items.eq(index).attr('href'), function(){
placeholders.eq(index).html(this);
});
return true;
}

// Load the image and execute a callback function.
Expand Down
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<link rel="stylesheet" href="assets/css/styles.css" />
<link rel="stylesheet" href="assets/touchTouch/touchTouch.css" />

<!-- Uncomment the next line to enable a close button, or add this to -->
<!-- a style sheet that you include after including touchTouch.css -->
<!-- <style>#closeButton {top:100px;}</style> -->

<!-- Google Fonts -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Dancing+Script" />

Expand Down