Duplicate/Remove: a jQuery Plugin

A simple plugin which makes it easy to duplicate and remove blocks of code.

Download…

Want to use “Duplicate/Remove” on your own website? No problem. You can download the full version.

Write Your Own…

Want to write your own plugin? I start all my plugins with a simple “skeleton” wrapper. Simply download my jQuery Plugin Skeleton and get started.

Run Code…

This page makes use of Run Code, a simple jquery plugin which converts your code examples to live behaviour.

Examples…

The default use of the plugin, which can created unlimited duplicates.

$('div.web').duplicate_remove();

This example is limited to a total of three duplicates, after which the duplicate button becomes disabled.

$('div.limited').duplicate_remove({
  'limit' : 3
});

This example shows all the options. Limited to a total of five duplicates, after which the duplicate button becomes disabled, the speed of the animation has changed and the text.

$('div.all').duplicate_remove({
  'limit' : 5,
  'duplicate' : {
    'text'	: 'More',
    'href'	: '#more',
    'speed' : 100
  },
  'remove' : {
    'text'	: 'Less',
    'href'	: '#less',
    'speed' : 250
  }
});