'
);
}
let size = (100/transition.count);
$divOver.find('div').each(function(){
let number = parseInt($(this).attr('data-number'));
if(transition.direction == MXS_HORIZONTAL_DIR)
clipSquare($(this), 0, number*size, 100, size);
else
clipSquare($(this), number*size, 0, size, 100);
if(dir == MXS_FORWARD){
$imageDivs.eq(nextTemp).css("z-index", "1").show(-1);
$imageDivs.eq(currentTemp).hide(-1).css("z-index", "0");
if(number%2 == 0){
$(this).animate(animated_even_forward, options.animation.speed);
}else{
$(this).animate(animated_odd_forward, options.animation.speed);
}
}else{
if(number%2 == 0){
$(this).css(animated_even_forward);
$(this).animate(animated_backward, options.animation.speed);
}else{
$(this).css(animated_odd_forward);
$(this).animate(animated_backward, options.animation.speed, function(){
$imageDivs.eq(currentTemp).css({"z-index":"0"}).hide(-1);
$imageDivs.eq(nextTemp).css({"z-index":"1"}).show(-1);
});
}
}
});
}
//Tiles transition
else if(transition.name == MXS_TILES.name)
{
let animated_forward = {},
animated_backward = {left:"0", top:"0"},
sqrt_count = Math.sqrt(transition.count);
let k = 0;
for(let i = 0;i\
\
'
);
k++;
}
}
let size = 100/sqrt_count;
$divOver.find('div').each(function(){
let x = parseInt($(this).attr('data-x')),
y = parseInt($(this).attr('data-y'));
clipSquare($(this), x*size, y*size, size)
});
let unitSpeed = options.animation.speed/transition.count;
//Animation width random order
if(transition.random)
{
let number = 0, $element, x, y, distance_left, distance_top, elements_numbers = [];//Couples' elements (x&y)
let element_number;
do{
do{
element_number = Math.floor(Math.random()*transition.count);
}while(elements_numbers.indexOf(element_number) != -1);
elements_numbers.push(element_number);
let $element = $divOver.find('div[data-number="'+element_number+'"]');
animated_forward.left = (Math.floor(Math.random()*2) == 0) ? '-100%' : '100%';
animated_forward.top = (Math.floor(Math.random()*2) == 0) ? '-100%' : '100%';
if(dir == MXS_FORWARD){
$imageDivs.eq(nextTemp).css("z-index", "1").show(-1);
$imageDivs.eq(currentTemp).hide(-1).css("z-index", "0");
$element.animate(animated_forward, unitSpeed*(number+1));
}else{
$element.css(animated_forward);
if(number == transition.count-1){
$element.animate(animated_backward, unitSpeed*(number+1), function(){
$imageDivs.eq(currentTemp).css({"z-index":"0"}).hide(-1);
$imageDivs.eq(nextTemp).css({"z-index":"1"}).show(-1);
});
}else{
$element.animate(animated_backward, unitSpeed*(number+1));
}
}
number++;
}while(number < transition.count);
}
//Animation with defined order
else
{
let number = 0, $element;
if(dir == MXS_FORWARD){
$imageDivs.eq(nextTemp).css("z-index", "1").show(-1);
$imageDivs.eq(currentTemp).hide(-1).css("z-index", "0");
}
animated_forward.left = (Math.floor(Math.random()*2) == 0) ? '-100%' : '100%';
animated_forward.top = (Math.floor(Math.random()*2) == 0) ? '-100%' : '100%';
for(let i = 0;iThis is Animated & Automatic Slideshow HTML CSS JQuery. Complete preview with syntax highlighting of html, css, js or javascript source code.