If you are using jQuery and have a CSS class called .draggable_rectangle
, how can开发者_高级运维 you create a button that will draw a copy of the rectangle each time the user clicks the button?
<button id="copy_rectangle"></button>
<script>
$("#copy_retangle").click(function(){
$(".draggable_rectangle").clone().appendTo("body");
// add extra code to make it draggable
});
</script>
精彩评论