Kloner
A tiny, dependency-free JavaScript module for cloning/repeating elements.
Install / Use
/learn @fivefifteen/KlonerREADME
Kloner
A tiny, dependency-free JavaScript module for cloning/repeating elements.
<a href="https://fivefifteen.com" target="_blank"><img src="./assets/fivefifteen.png" /><br /><b>A Five Fifteen Project</b></a>
</div>Demo
Visit https://kloner.js.org
Installation
Manual Download
Download dist/kloner.min.js and place the following HTML in your page's head element:
<script type="text/javascript" src="dist/kloner.min.js"></script>
CDN (Courtesy of jsDelivr)
Place the following HTML in your page's head element (check to make sure the version in the URL is the version you want):
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/fivefifteen/kloner@0.1/dist/kloner.min.js"></script>
NPM
npm install kloner --save
// ES6
import kloner from 'kloner'
// CommonJS
const kloner = require('kloner')
Fetcher
fetcher install fivefifteen/kloner --save
Bower
bower install fivefifteen/kloner --save
Usage
kloner Function
kloner([containerSelector], [childSelector], [options])
Initializes Kloner.
Parameters
-
containerSelector(Optional) - -
childSelector(Optional) - -
options(Optional) -
Examples
window.addEventListener('load', function () {
kloner()
})
Options
{
afterAdd: null,
afterChildUpdate: null,
afterRemove: null,
beforeAdd: null,
beforeChildUpdate: null,
beforeRemove: null,
childSelector: '[data-kloner-template], :scope > *',
containerSelector: '[data-kloner], .kloner',
max: null,
min: 0,
parameters: null,
start: 0,
template: null,
updateChildren: false
}
Related
-
ColorTap - A tiny, dependency-free, color input field helper that utilizes the native color picker.
-
FileBokz - A tiny, dependency-free, highly customizable and configurable, easy to use file input with some pretty sweet features.
-
GrowField - A tiny, dependency-free JavaScript module for making textarea elements grow with their content.
-
HashJump - A tiny, dependency-free JavaScript module for handling anchor links and scrolling elements into view.
License
MIT. See the license file for more info.
Related Skills
node-connect
347.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
