The essence of the problem: I made a selectbox based on jquery-ui, the first select works fine, but the new ones do not want to open the list. Almost all Google shoveled, but I did not find any answers for myself: ((

add selectmenu

$(function() { $.widget( "custom.iconselectmenu", $.ui.selectmenu, { _renderItem: function( ul, item ) { var li = $( "<li>", { text: item.label } ); if ( item.disabled ) { li.addClass( "ui-state-disabled" ); } $( "<span>", { style: item.element.attr( "data-style" ), "class": "ui-icon " + item.element.attr( "data-class" ) }) .appendTo( li ); return li.appendTo( ul ); } }); $( ".people" ) .iconselectmenu() .iconselectmenu( "menuWidget") .addClass( "ui-menu-icons avatar" ); }); 

    1 answer 1

    Found the solution myself. It turns out everything is quite simple (and I broke my head for half a day), everything is solved in 4 lines)

     $("#add").on("click", function() { $(".init-ui").iconselectmenu("destroy"); // Π£Π½ΠΈΡ‡Ρ‚ΠΎΠΆΠ°Π΅ΠΌ ΠΏΠ»Π°Π³ΠΈΠ½ $(".sub-block1").clone(true).appendTo(".block"); // ΠšΠ»ΠΎΠ½ΠΈΡ€ΡƒΠ΅ΠΌ ΠΈ ΠΏΠ΅Ρ€Π΅ΠΌΠ΅Ρ‰Π°Π΅ΠΌ элСмСнт Π² ΠΊΠΎΠ½Π΅Ρ† родитСля $(".init-ui").iconselectmenu().iconselectmenu("menuWidget").addClass("ui-menu-icons avatar"); // ВосстанавливаСм ΠΏΠ»Π°Π³ΠΈΠ½ });