').appendTo( $carousel_items );
$the_carousel_items.data('position', '');
if ( the_carousel_items.length <= columns ) {
$carousel_items.find('.tm-pb-slider-arrows').hide();
} else {
$carousel_items.find('.tm-pb-slider-arrows').show();
}
for ( position = 1, x=0 ;x < the_carousel_items.length; x++, position++ ) {
if ( x < columns ) {
$( the_carousel_items[x] ).show();
$( the_carousel_items[x] ).appendTo( $carousel_group );
$( the_carousel_items[x] ).data('position', position );
$( the_carousel_items[x] ).addClass('position_' + position );
} else {
position = $( the_carousel_items[x] ).data('position');
$( the_carousel_items[x] ).removeClass('position_' + position );
$( the_carousel_items[x] ).data('position', '' );
$( the_carousel_items[x] ).hide();
}
}
$the_carousel.data('columns_setting_up', false );
} /* end set_carousel_columns() */
$tm_carousel.tm_carousel_move_to = function ( direction ) {
var $active_carousel_group = $carousel_items.find('.tm-carousel-group.active'),
items = $carousel_items.data('items'),
columns = $carousel_items.data('portfolio-columns');
$tm_carousel.tm_animation_running = true;
var left = 0;
$active_carousel_group.children().each(function(){
$(this).css({'position':'absolute', 'left': left });
left = left + $(this).outerWidth(true);
});
if ( direction == 'next' ) {
var $next_carousel_group,
current_position = 1,
next_position = 1,
active_items_start = items.indexOf( $active_carousel_group.children().first()[0] ),
active_items_end = active_items_start + columns,
next_items_start = active_items_end,
next_items_end = next_items_start + columns;
$next_carousel_group = $('
').insertAfter( $active_carousel_group );
$next_carousel_group.css({ 'width': $active_carousel_group.innerWidth() }).show();
// this is an endless loop, so it can decide internally when to break out, so that next_position
// can get filled up, even to the extent of an element having both and current_ and next_ position
for( x = 0, total = 0 ; ; x++, total++ ) {
if ( total >= active_items_start && total < active_items_end ) {
$( items[x] ).addClass( 'changing_position current_position current_position_' + current_position );
$( items[x] ).data('current_position', current_position );
current_position++;
}
if ( total >= next_items_start && total < next_items_end ) {
$( items[x] ).data('next_position', next_position );
$( items[x] ).addClass('changing_position next_position next_position_' + next_position );
if ( !$( items[x] ).hasClass( 'current_position' ) ) {
$( items[x] ).addClass('container_append');
} else {
$( items[x] ).clone(true).appendTo( $active_carousel_group ).hide().addClass('delayed_container_append_dup').attr('id', $( items[x] ).attr('id') + '-dup' );
$( items[x] ).addClass('delayed_container_append');
}
next_position++;
}
if ( next_position > columns ) {
break;
}
if ( x >= ( items.length -1 )) {
x = -1;
}
}
var sorted = $carousel_items.find('.container_append, .delayed_container_append_dup').sort(function (a, b) {
var el_a_position = parseInt( $(a).data('next_position') );
var el_b_position = parseInt( $(b).data('next_position') );
return ( el_a_position < el_b_position ) ? -1 : ( el_a_position > el_b_position ) ? 1 : 0;
});
$( sorted ).show().appendTo( $next_carousel_group );
var left = 0;
$next_carousel_group.children().each(function(){
$(this).css({'position':'absolute', 'left': left });
left = left + $(this).outerWidth(true);
});
$active_carousel_group.animate({
left: '-100%'
}, {
duration: settings.slide_duration,
complete: function() {
$carousel_items.find('.delayed_container_append').each(function(){
left = $( '#' + $(this).attr('id') + '-dup' ).css('left');
$(this).css({'position':'absolute', 'left': left });
$(this).appendTo( $next_carousel_group );
});
$active_carousel_group.removeClass('active');
$active_carousel_group.children().each(function(){
position = $(this).data('position');
current_position = $(this).data('current_position');
$(this).removeClass('position_' + position + ' ' + 'changing_position current_position current_position_' + current_position );
$(this).data('position', '');
$(this).data('current_position', '');
$(this).hide();
$(this).css({'position': '', 'left': ''});
$(this).appendTo( $carousel_items );
});
$active_carousel_group.remove();
}
} );
next_left = $active_carousel_group.width() + parseInt( $the_carousel_items.first().css('marginRight').slice(0, -2) );
$next_carousel_group.addClass('active').css({'position':'absolute', 'top':0, left: next_left });
$next_carousel_group.animate({
left: '0%'
}, {
duration: settings.slide_duration,
complete: function(){
$next_carousel_group.removeClass('next').addClass('active').css({'position':'', 'width':'', 'top':'', 'left': ''});
$next_carousel_group.find('.changing_position').each(function( index ){
position = $(this).data('position');
current_position = $(this).data('current_position');
next_position = $(this).data('next_position');
$(this).removeClass('container_append delayed_container_append position_' + position + ' ' + 'changing_position current_position current_position_' + current_position + ' next_position next_position_' + next_position );
$(this).data('current_position', '');
$(this).data('next_position', '');
$(this).data('position', ( index + 1 ) );
});
$next_carousel_group.children().css({'position': '', 'left': ''});
$next_carousel_group.find('.delayed_container_append_dup').remove();
$tm_carousel.tm_animation_running = false;
}
} );
} else if ( direction == 'previous' ) {
var $prev_carousel_group,
current_position = columns,
prev_position = columns,
columns_span = columns - 1,
active_items_start = items.indexOf( $active_carousel_group.children().last()[0] ),
active_items_end = active_items_start - columns_span,
prev_items_start = active_items_end - 1,
prev_items_end = prev_items_start - columns_span;
$prev_carousel_group = $('
').insertBefore( $active_carousel_group );
$prev_carousel_group.css({ 'left': '-' + $active_carousel_group.innerWidth(), 'width': $active_carousel_group.innerWidth() }).show();
// this is an endless loop, so it can decide internally when to break out, so that next_position
// can get filled up, even to the extent of an element having both and current_ and next_ position
for( x = ( items.length - 1 ), total = ( items.length - 1 ) ; ; x--, total-- ) {
if ( total <= active_items_start && total >= active_items_end ) {
$( items[x] ).addClass( 'changing_position current_position current_position_' + current_position );
$( items[x] ).data('current_position', current_position );
current_position--;
}
if ( total <= prev_items_start && total >= prev_items_end ) {
$( items[x] ).data('prev_position', prev_position );
$( items[x] ).addClass('changing_position prev_position prev_position_' + prev_position );
if ( !$( items[x] ).hasClass( 'current_position' ) ) {
$( items[x] ).addClass('container_append');
} else {
$( items[x] ).clone(true).appendTo( $active_carousel_group ).addClass('delayed_container_append_dup').attr('id', $( items[x] ).attr('id') + '-dup' );
$( items[x] ).addClass('delayed_container_append');
}
prev_position--;
}
if ( prev_position <= 0 ) {
break;
}
if ( x == 0 ) {
x = items.length;
}
}
var sorted = $carousel_items.find('.container_append, .delayed_container_append_dup').sort(function (a, b) {
var el_a_position = parseInt( $(a).data('prev_position') );
var el_b_position = parseInt( $(b).data('prev_position') );
return ( el_a_position < el_b_position ) ? -1 : ( el_a_position > el_b_position ) ? 1 : 0;
});
$( sorted ).show().appendTo( $prev_carousel_group );
var left = 0;
$prev_carousel_group.children().each(function(){
$(this).css({'position':'absolute', 'left': left });
left = left + $(this).outerWidth(true);
});
$active_carousel_group.animate({
left: '100%'
}, {
duration: settings.slide_duration,
complete: function() {
$carousel_items.find('.delayed_container_append').reverse().each(function(){
left = $( '#' + $(this).attr('id') + '-dup' ).css('left');
$(this).css({'position':'absolute', 'left': left });
$(this).prependTo( $prev_carousel_group );
});
$active_carousel_group.removeClass('active');
$active_carousel_group.children().each(function(){
position = $(this).data('position');
current_position = $(this).data('current_position');
$(this).removeClass('position_' + position + ' ' + 'changing_position current_position current_position_' + current_position );
$(this).data('position', '');
$(this).data('current_position', '');
$(this).hide();
$(this).css({'position': '', 'left': ''});
$(this).appendTo( $carousel_items );
});
$active_carousel_group.remove();
}
} );
prev_left = (-1) * $active_carousel_group.width() - parseInt( $the_carousel_items.first().css('marginRight').slice(0, -2) );
$prev_carousel_group.addClass('active').css({'position':'absolute', 'top':0, left: prev_left });
$prev_carousel_group.animate({
left: '0%'
}, {
duration: settings.slide_duration,
complete: function(){
$prev_carousel_group.removeClass('prev').addClass('active').css({'position':'', 'width':'', 'top':'', 'left': ''});
$prev_carousel_group.find('.delayed_container_append_dup').remove();
$prev_carousel_group.find('.changing_position').each(function( index ){
position = $(this).data('position');
current_position = $(this).data('current_position');
prev_position = $(this).data('prev_position');
$(this).removeClass('container_append delayed_container_append position_' + position + ' ' + 'changing_position current_position current_position_' + current_position + ' prev_position prev_position_' + prev_position );
$(this).data('current_position', '');
$(this).data('prev_position', '');
position = index + 1;
$(this).data('position', position );
$(this).addClass('position_' + position );
});
$prev_carousel_group.children().css({'position': '', 'left': ''});
$tm_carousel.tm_animation_running = false;
}
} );
}
}
}
$.fn.tm_pb_simple_carousel = function( options ) {
return this.each(function() {
new $.tm_pb_simple_carousel(this, options);
});
}
}(jQuery));
}
/*
FILE ARCHIVED ON 06:47:15 Nov 24, 2024 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 17:26:12 Apr 22, 2026.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
*/
/*
playback timings (ms):
capture_cache.get: 0.404
load_resource: 27.014
PetaboxLoader3.datanode: 19.772 (2)
loaddict: 15.432
*/