Задать вопрос
AlibekKulseitov
@AlibekKulseitov
Люблю верстать и писать музыку

Проблема с magific popup галерей?

Как избавиться от дублирования изоображения? я так понял он считывает и при просмотре добавляет в галерею картинку из <img> и из <a></a>

Ссылка на сайт
Вот тут пример найдите блок с назаванием КОМПЛЕКС
MAJESTIC SEA VILLAGE

<div class="catalog-photo-wrapper">
				<a href="img/majestic/big/1.jpg" data-group="1" class="catalog-image-link magnificImage">
					<img class="lazy catalog-image" data-src="img/majestic/1.jpg">
					<span class="catalog-overlay"></span>
					<span class="zoom-green zoom-icon"></span>
				</a>
			</div>


// Allow opening images 
var groups = {};
$('.magnificImage').each(function() {
  var id = parseInt($(this).attr('data-group'), 30);
  
  if(!groups[id]) {
    groups[id] = [];
  } 
  
  groups[id].push( this );
});

$.each(groups, function() {

  $(this).magnificPopup({ 
	type: 'image',
	mainClass: 'mfp-zoom-in',
	tLoading: '',
	gallery: {
		enabled: true,
		navigateByImgClick: true,
		preload: [0,1] // Will preload 0 - before current, and 1 after the current image
	},
	removalDelay: 500, //delay removal by X to allow out-animation
	callbacks: {
	
	imageLoadComplete: function() {
		var self = this;
		setTimeout(function() {
			self.wrap.addClass('mfp-image-loaded');
		}, 16);
	},
		close: function() {
		this.wrap.removeClass('mfp-image-loaded');
	},
	

	// don't add this part, it's just to avoid caching of image
	beforeChange: function() {
	 this.items[0].src = this.items[0].src + '?=' + Math.random(); 
	}
  },
  
  closeBtnInside: false,
  closeOnContentClick: true,
  midClick: true
  })
  
});
  • Вопрос задан
  • 164 просмотра
Подписаться 1 Оценить 1 комментарий
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы