You have to set the needed plugin data-attribute
and than execute the plugin on the newly created and appended element.
Code:
$(document).ready(function () {
var add_osc = $('li#add_osc');
var osc;
var add_dest = $('li#add_dest');
var dest;
var add_fx = $('li#add_fx');
var fx = $('.fx');
//hide sound fx in menu
$(".fx").hide();
//general purpose knob <----- **PROBLEM CODE** -----!
add_osc.click(function () {
var $input=$("<input type='text'>")
$input.addClass('dial');
$input.attr('data-min', 0);
$input.attr('data-max', 100);
$input.attr('data-displayPrevious', true);
$input.attr('data-lineCap', 'round');
$input.attr('data-width', 100);
$input.val(0);
$("body").append($input);
$input.knob();
});
//toggle fx list
add_fx.click(function () {
fx.toggle();
});
});