Created
October 15, 2013 16:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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