scan


目录

title: 'Iconify SVG Framework Function: scan'
functions:
  observe: './observe.md'
  stopObserving: './stop-observing.md'
  pauseObserver: './pause-observer.md'
  resumeObserver: './resume-observer.md'

SVG framework function: scan

This tutorial is part of Iconify SVG Framework functions tutorial.

Function [func]scan() scans document for icon placeholders and replaces placeholders with icons.

SVG framework automatically watches [prop]document.body and scans DOM after every change, so no need to use this function after you are changing DOM.

When to use this function:

If you want SVG framework to watch custom root element for changes, do not use this function, use [func]observe() instead. This function stops watching element when all placeholders have been replaced, [func]observe() continues to watch element until you tell it to stop using [func]stopObserving().

Usage

Function has the following optional parameter:

Example

const node = document.createElement('div');
node.innerHTML =
	'Home icon: <span class="iconify" data-icon="mdi:home"></span>';
Iconify.scan(node);

Notes


版本号 #2
由 壳壳虫 创建于 2026-10-31 14:20:51 UTC
由 壳壳虫 更新于 2026-10-31 14:20:52 UTC