Skip to content

Instantly share code, notes, and snippets.

@wycks
Created May 13, 2012 05:46
Show Gist options
  • Save wycks/2685422 to your computer and use it in GitHub Desktop.
Save wycks/2685422 to your computer and use it in GitHub Desktop.
Jquery UI drag and drop counter
$(function() {
$( "#drag-me" ).draggable();
$( "#drop" ).droppable({
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
$('#counter').html(function(i, val) {
return val * 1 + 1
});
}
});
});​
//http://jsfiddle.net/hRznb/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment