From 5a5df42d83df97e77a75c4f82b8c97d36731da51 Mon Sep 17 00:00:00 2001 From: Petyas Date: Mon, 24 Jun 2013 12:16:11 +0300 Subject: [PATCH] Added close button to overlay --- assets/touchTouch/touchTouch.jquery.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/touchTouch/touchTouch.jquery.js b/assets/touchTouch/touchTouch.jquery.js index 65afeae..fc3c184 100644 --- a/assets/touchTouch/touchTouch.jquery.js +++ b/assets/touchTouch/touchTouch.jquery.js @@ -15,6 +15,7 @@ slider = $('
'), prevArrow = $(''), nextArrow = $(''), + closeButton = $(''), overlayVisible = false; @@ -143,7 +144,7 @@ // If the browser does not have support // for touch, display the arrows if ( !("ontouchstart" in window) ){ - overlay.append(prevArrow).append(nextArrow); + overlay.append(prevArrow).append(nextArrow).append(closeButton); prevArrow.click(function(e){ e.preventDefault(); @@ -154,6 +155,11 @@ e.preventDefault(); showNext(); }); + + closeButton.click(function(e){ + e.preventDefault(); + hideOverlay(); + }); } // Listen for arrow keys @@ -289,4 +295,4 @@ } }; -})(jQuery); \ No newline at end of file +})(jQuery);