File manager - Edit - /home/jardides/www/Jardi-design/j37/plugins/pagebuilderck/testimonials/assets/testimonials.js
Back
/** * @name Page Builder CK * @package com_pagebuilderck * @copyright Copyright (C) 2015. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr */ /* * Plugin to manage the testimonials */ (function($){ $.fn.PBCK_testimonials = function(opts) { var testimonials = $(this); if (testimonials.data('processed') == '1') return testimonials; var defaults = { // autoplay: 'false', }; var opts = $.extend({}, defaults, opts); var isInterface = testimonials.parents('#workspaceck').length || testimonials.parents('#previewarea').length; var loader; var rad = 0; var radSum = 0.005; opts.autoplay = testimonials.find('.pbck_testimonials').attr('data-autoplay') == '1' && !isInterface; opts.pausehover = testimonials.find('.pbck_testimonials').attr('data-pausehover') == '1' && !isInterface; opts.time = testimonials.find('.pbck_testimonials').attr('data-time') || 5000; testimonials.anim = function(control) {animate(control)}; // if (testimonials.data('processed') == '1') return testimonials; testimonials.data('processed', '1'); init(); // activate autoplay only if not in edition mode if (opts.autoplay ) autoplay(); // testimonials.find('.pbck_testimonials_control').click(function() { // animate($(this)); // }); if (opts.pausehover == '1') { testimonials.hover( function() { $(this).addClass('pausedck'); }, function() { $(this).removeClass('pausedck'); } ); } function init() { testimonials.removeClass('pbck_animate'); testimonials.height(''); testimonials.find('.pbck_wrapinner') .width((testimonials.find('.pbck_testimonial').length*100)+'%') .css('marginLeft', '0'); testimonials.find('.pbck_testimonial').width((100/testimonials.find('.pbck_testimonial').length)+'%'); testimonials.find('.pbck_testimonial.current').removeClass('current'); testimonials.find('.pbck_testimonial').eq(0).addClass('current'); testimonials.addClass('pbck_animate'); } function next() { animate(testimonials.find('.control_next')); } function prev() { animate(testimonials.find('.control_prev')); } function animate(control) { var nb = testimonials.find('.pbck_testimonial').length; var index; var cur_testimonial = testimonials.find('.pbck_testimonial.current'); if ($(control).hasClass('control_next')) { if (testimonials.find('.pbck_testimonial.current').next().length) { index = testimonials.find('.pbck_testimonial').index(cur_testimonial) + 1; } else { index = 0; } } else { if (testimonials.find('.pbck_testimonial.current').prev().length) { index = testimonials.find('.pbck_testimonial').index(cur_testimonial) - 1; } else { index = nb - 1; } } testimonials.find('.pbck_wrapinner').css('margin-left', '-'+(index*100)+'%'); testimonials.find('.pbck_testimonial.current').removeClass('current'); testimonials.find('.pbck_testimonial').eq(index).addClass('current'); testimonials.animate({'height': testimonials.find('.pbck_testimonial').eq(index).height()}, 300); resetAutoplay(); if (opts.autoplay) autoplay(); } function autoplay() { if (! opts.autoplay) return; // if (testimonials.hasClass('pausedck')) return; clearInterval(loader); loader = setInterval( function(){ if(rad<1 && !testimonials.hasClass('pausedck')){ rad = (rad+radSum); if (rad > 1) rad = 1; // pieLoaderBar.css({'width':(rad*100)+'%'}); } else if (rad<=1 && testimonials.hasClass('pausedck')){ rad = rad; } else { clearInterval(loader); if(!testimonials.hasClass('pausedck')) { resetAutoplay(); next(); } } } , opts.time*radSum); } function resetAutoplay() { clearInterval(loader); rad = 0; // pieLoaderBar.css('width', '0'); } return testimonials; }; })(jQuery); function pbck_testimonials_init(testimonialsname) { document.getElementById(testimonialsname).pbcktestimonials = jQuery('#'+testimonialsname).PBCK_testimonials(); } function pbck_testimonials_show(control) { jQuery(control).parents('.pbck_testimonials.inner, .pbck_testimonier')[0].pbcktestimonials.anim(control); } jQuery(document).ready(function(){ // Loop though all testimonialss to initialise them // .pbck_testimonials.inner used for backward compatibility jQuery('.pbck_testimonials.inner, .pbck_testimonier').each(function() { this.pbcktestimonials = jQuery(this).PBCK_testimonials(); }); }); /* function pbck_testimonials_init(testimonialsname) { var testimonials = jQuery('#'+testimonialsname); testimonials.find('.pbck_wrapinner').width((testimonials.find('.pbck_testimonial').length*100)+'%'); testimonials.find('.pbck_testimonial').width((100/testimonials.find('.pbck_testimonial').length)+'%'); testimonials.find('.pbck_testimonial.current').removeClass('current'); testimonials.find('.pbck_testimonial').eq(0).addClass('current'); } function pbck_testimonials_show(control) { var testimonials = jQuery(jQuery(control).parents('.pbck_testimonials')[0]); var nb = testimonials.find('.pbck_testimonial').length; var index; var cur_testimonial = testimonials.find('.pbck_testimonial.current'); if (jQuery(control).hasClass('control_next')) { if (testimonials.find('.pbck_testimonial.current').next().length) { index = testimonials.find('.pbck_testimonial').index(cur_testimonial) + 1; } else { index = 0; } } else { if (testimonials.find('.pbck_testimonial.current').prev().length) { index = testimonials.find('.pbck_testimonial').index(cur_testimonial) - 1; } else { index = nb - 1; } } testimonials.find('.pbck_wrapinner').css('margin-left', '-'+(index*100)+'%'); testimonials.find('.pbck_testimonial.current').removeClass('current'); testimonials.find('.pbck_testimonial').eq(index).addClass('current'); testimonials.animate({'height': testimonials.find('.pbck_testimonial').eq(index).height()}, 300); jQuery(window).bind('resize',function(){ testimonials.animate({'height': testimonials.find('.pbck_testimonial').eq(index).height()}, 300); }); } */
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings