jquery - Draggable not working after append -


im having trouble making buttons draggable after append() through ajax call.

does see obvious error? thanks!

$(document).ready(function () {     $("#exautotxt").keypress(function () {         $.ajax({             url: '@url.action("exerciseautocomplete")',             datatype: "json",             data: {                 'term': $("#exautotxt").val()             },             datatype: "text",             success: function (data) {                 var exarray = json.parse(data);                 $(".exresults").html("");                 (var x = 0; x < exarray.length ; x++) {                     $(".exresults").append("<button class='exnamebtn btn'>" + exarray[x] + "</button> <br/> <br/>");                 }                   $('.exnamebtn').draggable();              }         });     }) }); 

buttons fire request on click default. need disable cancel: false enable dragging:

$('.exnamebtn').draggable({cancel: false;}); 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -