Skip to content

Instantly share code, notes, and snippets.

@jojo89
Created October 15, 2013 16:05
Show Gist options
  • Save jojo89/6993986 to your computer and use it in GitHub Desktop.
Save jojo89/6993986 to your computer and use it in GitHub Desktop.
var Board = function( selector ) {
// Your board related code goes here
// Use $elem to access the DOM element for this board
var $elem = $( selector );
$elem.droppable({
drop: function(event, the_new_item){
$(this).append(the_new_item.draggable.clone())
$(the_new_item).remove();
}
});
};
var PostIt = function(element) {
// Your post-it related code goes here
this.element= element
this.drag= element.draggable({
helper: "clone",
});
};
$(function() {
// This code will run when the DOM has finished loading
board = new Board('#board');
$('#board').on('click',function(){
post = new PostIt($("<div class="+"post-it"+"></div>"));
$('#board').append(post.drag)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment