Skip to content

Commit

Permalink
v1.3a
Browse files Browse the repository at this point in the history
Forgot to mention the new option to change sliding effects easing!
  • Loading branch information
LCweb-ita committed Nov 2, 2017
1 parent 141c2e9 commit ea344d1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 29 deletions.
41 changes: 27 additions & 14 deletions js/lc-micro-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

var settings = $.extend({
slide_fx : 'fadeslide', // (string) sliding effect / none - slide - fade - fadeslide - zoom-in - zoom-out
slide_easing : 'ease', // (string) CSS animation easing to use / ease - linear - ease-in (etc) [supports also cubic-bezier]
nav_arrows : true, // (bool) shows navigation arrows
nav_dots : true, // (bool) shows navigation dots
slideshow_cmd : true, // (bool) shows slideshow commands (play/pause)
Expand Down Expand Up @@ -88,20 +89,32 @@
}


// setup inline CSS for animation timings
$('head').append(
'<style type="text/css">'+
'.'+ vars.uniqid +' .lcms_before,'+
'.'+ vars.uniqid +' .lcms_after,'+
'.'+ vars.uniqid +' .lcms_prepare_for_prev,'+
'.'+ vars.uniqid +' .lcms_prepare_for_next {' +
'-webkit-animation-duration: '+ settings.animation_time +'ms !important;'+
'-ms-animation-duration: '+ settings.animation_time +'ms !important;'+
'animation-duration: '+ settings.animation_time +'ms !important;'+
'}</style>');

// animation class
$wrap_obj.find('.lcms_wrap').addClass('lcms_'+ settings.slide_fx +'_fx');
if(settings.slide_fx && settings.slide_fx != 'none') {

// use custom easing?
if(settings.slide_easing && settings.slide_easing != 'ease') {
var easing_code =
'-webkit-animation-timing-function: '+ settings.slide_easing +' !important;'+
'animation-timing-function: '+ settings.slide_easing +' !important;';
} else {
var easing_code = '';
}

// setup inline CSS for animation timings
$('head').append(
'<style type="text/css">'+
'.'+ vars.uniqid +' .lcms_before,'+
'.'+ vars.uniqid +' .lcms_after,'+
'.'+ vars.uniqid +' .lcms_prepare_for_prev,'+
'.'+ vars.uniqid +' .lcms_prepare_for_next {' +
'-webkit-animation-duration: '+ settings.animation_time +'ms !important;'+
'animation-duration: '+ settings.animation_time +'ms !important;'+
easing_code +
'}</style>');

// animation class
$wrap_obj.find('.lcms_wrap').addClass('lcms_'+ settings.slide_fx +'_fx');
}


// autoplay
Expand Down
31 changes: 16 additions & 15 deletions js/lc-micro-slider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ea344d1

Please sign in to comment.