Browse files

added click functionality for navigation in mobile browsers

  • Loading branch information...
1 parent ea4c80f commit 2f36e9a6b323b1d1114dc263b8e292f7b0e33c82 Joshua T Kalis committed Jun 1, 2011
Showing with 18 additions and 14 deletions.
  1. +18 −14 slideshow.jQuery.js
View
32 slideshow.jQuery.js
@@ -24,21 +24,25 @@
}
};
- $(document).keydown(function (event) {
- switch(event.keyCode) {
- case 37: // left arrow
- // case 38: // up arrow
- mv(-1);
- event.preventDefault();
- break;
- case 39: // right arrow
- // case 40: // down arrow
- mv(1);
- event.preventDefault();
- break;
+ $(document).
+ click(function (event) {
+ mv((event.pageX > Math.floor(document.width / 2)) ? 1 : -1);
+ }).
+ keydown(function (event) {
+ switch(event.keyCode) {
+ case 37: // left arrow
+ // case 38: // up arrow
+ mv(-1);
+ event.preventDefault();
+ break;
+ case 39: // right arrow
+ // case 40: // down arrow
+ mv(1);
+ event.preventDefault();
+ break;
- }
- });
+ }
+ });
mv();
return this;

0 comments on commit 2f36e9a

Please sign in to comment.