title: Delegate jquery ui sortable
body: <p>In my page load dynamically photos with ajax.
  For elements and functions I'm trying to use event delegation.
  Unfortunately for UI sortable I was forced to use the function referencing</p>
  
  <p>HTML dinamically generated from id</p>
  
  <pre><code>&lt;div class="row sortable"&gt;
      &lt;div class="col-md-2 thumb" id="photo_1"&gt;
          &lt;span class="thumbnail"&gt;
              &lt;img class="img-responsive" src="img_1.jpg" alt="" /&gt;
              &lt;input type="checkbox" name="photo[]" value="1" /&gt;
          &lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="col-md-2 thumb" id="photo_2"&gt;
          &lt;span class="thumbnail"&gt;
              &lt;img class="img-responsive" src="img_2.jpg" alt="" /&gt;
              &lt;input type="checkbox" name="photo[]" value="2" /&gt;
          &lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="col-md-2 thumb" id="photo_3"&gt;
          &lt;span class="thumbnail"&gt;
              &lt;img class="img-responsive" src="img_3.jpg" alt="" /&gt;
              &lt;input type="checkbox" name="photo[]" value="3" /&gt;
          &lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>MY JS</p>
  
  <pre><code>var id = "something";
  
  $.ajax({
      type: "POST",
      url: photo.php,
      data: { id : id },
      dataType: 'html',
      success: function(data) {
          $('#photo-container').html(data);
      },
      complete: function() {
          callSortable(); // Function referencing
      }
  });
  
  // DELEGATE
  $(document).on('change', 'input[name="photo[]"]', function() {
      // do something
  });
  
  function callSortable() {
      $('.sortable').sortable({
          items       : 'div:not(.unsortable)',
          delay       : 150,
          revert      : true,
          scroll      : false,
          update: function(e, ui) {
              //save position
          }
      });
  }
  </code></pre>
  
  <p>How could I do to use the event delegation with UI sortable in my scenario?
  Thank You</p>