kloner
v0.0.2
Published
A tiny, dependency-free JavaScript module for cloning/repeating elements.
Downloads
6
Maintainers
Readme
kloner
A tiny, dependency-free JavaScript module for cloning/repeating elements.
Note: This module is in beta and the documentation is incomplete.
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/kodie/[email protected]/dist/kloner.min.js"></script>
NPM
npm install kloner --save
// ES6
import kloner from 'kloner'
// CommonJS
const kloner = require('kloner')
GPM
gpm install kodie/kloner --save
Bower
bower install kodie/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
colorfield - 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.
hashjump - A tiny, dependency-free JavaScript module for handling anchor links and scrolling elements into view.
minitaur - The ultimate, dependency-free, easy to use, JavaScript plugin for creating and managing modals.
vanishing-fields - A dependency-free, easy to use, JavaScript plugin for hiding and showing fields.
License
MIT. See the license file for more info.