JQUERY CLONEABLE

¬°Clone everything!

Develop by Victor Valencia

Documentation

initialization
.cloneable( options ) Returns: jQuery Initialize plu-gin.
options Object
fadeEffect Boolean Indicates whether to use the fade effect when you add or remove items.

Default: true

events Object Custom events.
events Object
onCloneAdded(event) Function This event fires when the clone is added.

Properties of event value:

event.data Cloned item data.

event.index Cloned item index.

event.length Size of items cloned.

event.node Instance of cloned item.

onCloneRemoved(event) Function This event fires when the clone is removed.

Properties of event value:

event.index Index of the deleted item.

event.length Size of items cloned.

event.node Instance of cloned item.

addClone
.cloneable( 'addClone', options ) Returns: jQuery Add new clone.
options Array | Object
index Integer Item index.

Default: -1 Indicates the last item.

data Object Item data.

Default: {} Indicates empty data.

model String Model name.

Default: null Indicates the first model.

getModel
.cloneable( 'getModel', name ) Returns: jQuery Gets the specified model.
name String Model name.

Default: null Indicates the first model.

getData
.cloneable( 'getData', index ) Returns: Object Gets data from a specified index.
index Integer Item index.

Default: 0 Indicates the first item.

setData
.cloneable( 'setData', options ) Returns: jQuery Data sets of a specified index.
options Object
index Integer Item index.

Default: 0 Indicates the first index.

data Object Item data.

Default: {} Indicates a empty data.

changeModel
.cloneable( 'changeModel', options ) Returns: jQuery Changes the model of a specified index.
options Object
index Integer Item index.

Default: 0 Indicates the first index.

data Object Item data.

Default: {} Indicates a empty data.

model String Model name.

Default: null Indicates the first model.

removeClone
.cloneable( 'removeClone', index ) Returns: jQuery Remove an item from a specified index.
index Integer Item index.

Default: -1 Indicates the last item.

removeAllClone
.cloneable( 'removeAllClone' ) Returns: jQuery Remove all items.

All examples shown here including the home page using the Bootstrap framework with Jasny Extensions.

JQuery Cloneable © Victor Valencia Rico 2013. Released under the MIT license.