Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
Fixed slide transitions don't work on mobile #25
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbitron committed Sep 11, 2014
1 parent adee909 commit 9b40a93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
24 changes: 6 additions & 18 deletions ideal-image-slider.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
.iis-effect-slide.iis-direction-next .iis-previous-slide,
.iis-effect-slide.iis-direction-previous .iis-next-slide { opacity: 1; }

/* Touch styles */
.iis-touch-enabled .iis-slide { z-index: 1; }
.iis-touch-enabled .iis-current-slide { z-index: 2; }
.iis-touch-enabled.iis-is-touching .iis-previous-slide,
.iis-touch-enabled.iis-is-touching .iis-next-slide { opacity: 1; }

/* Fade effect */
.iis-effect-fade .iis-slide {
-webkit-transition-property: opacity;
Expand All @@ -71,21 +77,3 @@
.iis-effect-fade .iis-current-slide {
opacity: 1;
}

/* Touch effect */
.iis-effect-touch .iis-slide {
opacity: 0;
z-index: 1;
-webkit-transition-property: -webkit-transform;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
transition-property: transform;
-webkit-transition-timing-function: ease-out;
-moz-transition-timing-function: ease-out;
-o-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.iis-effect-touch .iis-current-slide { z-index: 2; }
.iis-effect-touch .iis-current-slide,
.iis-effect-touch.iis-is-touching .iis-previous-slide,
.iis-effect-touch.iis-is-touching .iis-next-slide { opacity: 1; }
4 changes: 3 additions & 1 deletion ideal-image-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ var IdealImageSlider = (function() {
previousNav: 'iis-previous-nav',
nextNav: 'iis-next-nav',
animating: 'iis-is-animating',
touchEnabled: 'iis-touch-enabled',
touching: 'iis-is-touching',
directionPrevious: 'iis-direction-previous',
directionNext: 'iis-direction-next'
Expand Down Expand Up @@ -412,9 +413,10 @@ var IdealImageSlider = (function() {

// Touch Navigation
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch){
this.settings.effect = 'touch';
this.settings.effect = 'slide';
previousNav.style.display = 'none';
nextNav.style.display = 'none';
_addClass(sliderEl, this.settings.classes.touchEnabled);

sliderEl.addEventListener('touchstart', _touch.start.bind(this), false);
sliderEl.addEventListener('touchmove', _touch.move.bind(this), false);
Expand Down
Loading

0 comments on commit 9b40a93

Please sign in to comment.