title: Shiny with jquery UI
body: <p>I want to use jquery UI with shiny (not using shinyjqui library). It works perfect when I have a layer and tried to move it using jqueryUI, but when this layer is dynamically generated using insertUI, then, it doesn´t work.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>library(shiny)
  
  ui &lt;- fluidPage(theme = "style.css",
              tags$script(src = "jquery-ui.js"),
              tags$script(src = "script2.js"),
              actionButton("add","Add layer"),
              div(class="aux"),
              div(id="works",style="width:300px;height:200px;background:red"))
  
  
  
  server &lt;- function(input, output, session) {
  
      observeEvent(input$add,{
      insertUI(
        selector = ".aux",
        where="afterEnd",
        ui  = div(id=paste0("new",input$add),style="width:300px;height:200px;background:blue")
  
      )
  
  
    })
  
  
  
  
  
  
  }
  shinyApp(ui, server)
  </code></pre>
  
  <p>And the js script</p>
  
  <pre><code>  $( function() {
  
  
      $("#works").draggable();
      $("#new1").draggable();
  
  
    });
  </code></pre>
  
  <p>Thanks!</p>