• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/assets/preprocessing/lazyload.php
  • Класс: BitrixLandingAssetsPreProcessingLazyload
  • Вызов: Lazyload::parseStyleImg
protected function parseStyleImg(DOMElement $node, string $selector): void
{
	if (
		($fileId = $node->getAttribute('data-fileid'))
		&& $fileId > 0
		&& ($fileArray = File::getFileArray($fileId))
	)
	{
		$width = $fileArray['WIDTH'];
		$height = $fileArray['HEIGHT'];

		$node->setAttribute('data-lazy-styleimg', 'Y');
		$node->setAttribute('data-style', $node->getAttribute('style'));

		$lazySrc = $this->createPlaceholderImage($width, $height);
		$node->setAttribute('style', "background-image:url({$lazySrc});");

		// todo: after add src in saveNode - get it too
	}
}