Kineticjs Cloning example

body {
margin: 0px;
padding: 0px;
canvas {
border: 1px solid #9C9898;
<script src=””></script&gt;
window.onload = function() {
var stage = new Kinetic.Stage({
container: ‘container’,
width: 578,
height: 200

var layer = new Kinetic.Layer();

var rect = new Kinetic.Rect({
x: 239,
y: 75,
width: 100,
height: 50,
fill: ‘green’,
stroke: ‘black’,
strokeWidth: 4,

var clone = rect.clone();
// add the clone to the layer

// add the layer to the stage

<div id=”container”></div>


Check in jsfiddle


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s