Skip to content
This repository was archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
fix out transition position
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Apr 25, 2018
1 parent 1018fec commit 141616a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/responsive-carousel.drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

// add the fast transition class to make transitions out of a drag quick
// remove any no-transition class so the transition out of the drag can work
$carousel.addClass("carousel-fast-transition");
$carousel.addClass("carousel-autoplay-stopped");
$both.removeClass("no-transition");

if( $( e.target ).attr( "data-transition" ) === "slide" ){
Expand All @@ -93,7 +93,7 @@
$( e.target ).trigger( "goto." + pluginName, newSlide ? $next : $current );

// remove the fast transition class so that other transitions can be slow
$carousel.removeClass("carousel-fast-transition");
$carousel.removeClass("carousel-autoplay-stopped");

// do the post transition cleanup to make sure that the state in the
// component is sane for future transitions and navigation
Expand All @@ -107,12 +107,15 @@
// if we're heading to a new slide move the slide out
(newSlide ? $current : $next)
.removeClass( activeClass )
.css( "left", data.deltaX > 0 ? data.w + "px" : -data.w + "px" );
.css( "left",
newSlide ?
(data.deltaX > 0 ? data.w + "px" : -data.w + "px") :
(data.deltaX > 0 ? -data.w + "px" : data.w + "px"));

// if we're heading to a new slide move the next one in
(newSlide ? $next : $current)
.addClass( activeClass )
.css( "left", 0);
.css( "left", 0 );
} else if( newSlide ){
$( e.target )[ pluginName ]( data.deltaX > 0 ? "prev" : "next" );
}
Expand Down
2 changes: 1 addition & 1 deletion src/responsive-carousel.slide.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
.carousel-item.no-transition {
transition: none !important;
}
.carousel-slide.carousel-fast-transition .carousel-item {
.carousel-slide.carousel-autoplay-stopped .carousel-item {
-webkit-transition: left .1s ease;
-moz-transition: left .1s ease;
-ms-transition: left .1s ease;
Expand Down

0 comments on commit 141616a

Please sign in to comment.