HEX
Server: Apache
System: Linux web2213.uni5.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64
User: clinicamaciel (596848)
PHP: 7.3.33
Disabled: apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,eval,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv
Upload Files
File: /home/clinicamaciel/www/wp-content/plugins/vc-extensions-bundle/thumbnailcaption/js/init.js
jQuery(document).ready(function($) {
	function _reiszeImage(){
		$('.card-image').each(function() {
			var maxWidth = $(this).data('maxwidth');
			var maxHeight = $(this).data('maxheight');
			var _mratio = maxWidth/maxHeight;
			var _imageContainer = $(this);
			$(this).find('img').each(function(index) {
				var ratio = $(this).data('ratio');
		        var width = $(this).data('width');
		        var height = $(this).data('height');
		        if(ratio<_mratio){
		        	// _imageContainer.css('width', maxWidth);
		        	// _imageContainer.css({
		        	// 	'width': maxWidth
		        	// });
		            $(this).css("min-height", maxHeight);
		        }

		        // Check if current height is larger than max
		        if(ratio>=_mratio){
		            // _imageContainer.css({
		            // 	'width': maxHeight*ratio
		            // });
		            // $(this).css("width", maxHeight*ratio);
		            $(this).css("min-width", maxWidth);
		        }



			});
	    });
	}

	$('.cq-cards-container').each(function(index) {
		var _this = $(this);
		var _imageposition = $(this).data('imageposition');
		var _backgroundcolor = $(this).data('backgroundcolor');
		var _captioncolor = $(this).data('captioncolor');
		var _buttonbg = $(this).data('buttonbg');
		var _buttonhoverbg = $(this).data('buttonhoverbg');
		var _minheight = $(this).data('minheight') || 160;
		var _smallheight = $(this).data('smallheight') || 100;
		var _autoplayspeed = $(this).data('autoplayspeed') || 4000;
		var _titlesize = $(this).data('titlesize') || '1.2em';
		_this.css({
			'background-color': _backgroundcolor,
			'color': _captioncolor
		});
		_this.find('h3').css({
			'color': _captioncolor,
			'font-size': _titlesize
		});;
		$('.card-image-container', _this).css({
			'height': _minheight
		});
		if(_buttonbg!=""){
			var _buttons = $('.card-caption-container .cq-button', _this);
			_buttons.css('background-color', _buttonbg);
			_buttons.on('mouseover', function(event) {
				$(this).css('background-color', _buttonhoverbg);
			}).on('mouseleave', function(event) {
				$(this).css('background-color', _buttonbg);
			});

		}
		var _carousel = $('.card-image', _this).slick({
			arrow: false,
			dots: false,
		    slidesToShow: 1,
		    autoplay: true,
		    autoplaySpeed: _autoplayspeed,
		    slidesToScroll: 1,
		    infinite: false,
		    arrows: false
		});
		var _index = index;
		_this.find('a.cq-thumb-lightbox').each(function(index) {
				$(this).attr('rel', 'cq-gallery'+_index).boxer({
					fixed : true
		   		});
		});
		$(window).on('resize', function(event) {
			var _w = $(this).width();
			if(_w<=480){
				// $('.card-image-container, .card-caption-container', _this).css({
				// 	'height': _smallheight
				// });
			}else{
				if(_imageposition!="top"&&_imageposition!="bottom"){
				var _containerheight = $('.card-image-container', _this).height();
				var _captionheight = $('.card-caption-container', _this).height();
					$('.card-caption-container', _this).css('margin-top', (_containerheight - _captionheight)*0.5);
				}

			}

			// var _cwidth = $('.caption-content', _this).outerWidth();
			// var _cheight = $('.caption-content', _this).outerHeight();
			// var _w = $(this).width();
			// if(_w>=768){
			// 	// $('.card-caption-container', _this).css({
			// 	// 	'min-height': _cheight
			// 	// });

			// }else{
			// 	$('.card-caption-container', _this).css({
			// 		'height': _cheight
			// 	});
			// 	$('.card-image-container', _this).css({
			// 		'height': _cheight
			// 	})
			// }
			// $('.card-image').data('maxwidth', _cwidth);
			// $('.card-image').data('maxheight', _cheight);
			// $('.card-image-container', _this).css({
			// 	'height': _cheight
			// });
			// if(!$('.card-image-container', _this).hasClass('top')){
				// $('.card-image').css({
				// 	'width': _cwidth
				// 	// 'height': _cheight
				// });;
				// $('.cq-link-block').css('height', _cheight)
				// _reiszeImage();
			// }
			// _reiszeImage();

		});
		$(window).trigger('resize');

	});

});