jQuery(document).ready(function($){
'use strict';
$('.testimonial-slider').each(function(){
var $this=$(this);
$this.owlCarousel({
lazyLoad: true,
items: $this.data('items'),
loop: $this.data('loop'),
margin: $this.data('margin'),
autoplay: $this.data('autoplay'),
autoplaySpeed: $this.data('autoplay-speed'),
autoplayTimeout: $this.data('autoplay-timeout'),
autoplayHoverPause: $this.data('stop-hover'),
nav: $this.data('navigation'),
dots: $this.data('pagination'),
navText: [
'<span class="owl-prev-icon" aria-label="Previous slide" role="button"><i class="fa fa-angle-left" aria-hidden="true"></i></span>',
'<span class="owl-next-icon" aria-label="Next slide" role="button"><i class="fa fa-angle-right" aria-hidden="true"></i></span>'
],
smartSpeed: 450,
responsive: {
0: { items: $this.data('itemsmobile') },
678: { items: $this.data('itemsdesktopsmall') },
980: { items: $this.data('itemsdesktop') },
1199: { items: $this.data('items') }}
});
});
$('.read-more-link').on('click', function(e){
e.preventDefault();
var testimonialId=$(this).data('testimonial-id');
var popupContent=$('#' + testimonialId).html();
$.magnificPopup.open({
items: {
src: '<div class="mfp-content-wrapper">' + popupContent + '</div>',
type: 'inline'
},
closeBtnInside: true,
mainClass: 'mfp-fade',
removalDelay: 300,
callbacks: {
beforeOpen: function(){
this.st.mainClass='mfp-fade';
},
beforeClose: function(){
$('.mfp-close').remove();
}}
});
});
});