Advertisement
deliciousthemes

Testimonials

Sep 3rd, 2015
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Testimonials Slider
  2. jQuery(window).load(function() {   
  3.     'use strict';
  4.     jQuery('.testimonials-slider[id^="owl-testimonials"]').each( function() {  
  5.  
  6.         var $div = jQuery(this);
  7.         var token = $div.data('token');
  8.         var bool = true;
  9.  
  10.         var settingObj = window['dt_testimonials_' + token];   
  11.         if((settingObj.testimonial_speed == '') || (settingObj.testimonial_speed == 'false')) {
  12.             bool = false;
  13.         }
  14.         jQuery("#owl-testimonials-"+settingObj.id+"").owlCarousel({
  15.             autoHeight : true,
  16.             items : 1,
  17.             nav: true,
  18.             navText: [
  19.                   "<i class='fa fa-angle-left'></i>",
  20.                   "<i class='fa fa-angle-right'></i>"
  21.                   ],               
  22.             rewind: true,
  23.             rtl: false,
  24.             autoplay: bool,
  25.             autoplayTimeout: settingObj.testimonial_speed,         
  26.             autoplayHoverPause: true,
  27.             dots: false,
  28.             onInitialized: owlcallback,
  29.             onChanged: owlcallback
  30.         });    
  31.  
  32.         function owlcallback(event){
  33.             var items     = event.item.count;     // Number of items
  34.             var item      = event.item.index;     // Position of the current item
  35.             jQuery('.testimonials-slider-no-'+settingObj.id+'').text(""+(item+1)+"/" + items+"");
  36.  
  37.         }  
  38.     });
  39. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement