title: zeroclipboard copy text inside jquery dialog doesn't work
body: <p>I am using jquery ui dialog in my page and surprisingly the zeroclipboard copy-to-clipboard functionality does not work from within the jquery dialog box.</p>
  
  <p>This is my entire code... </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/smoothness/jquery-ui.css" rel="stylesheet" 
      type="text/css" /&gt;
      &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="http://davidwalsh.name/dw-content/ZeroClipboard.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript"&gt; 
      $(function(){
          $('#ex1').click(function(){
              var div = $('#div1');
              div.dialog(
                  {
                      title:'Dialog1',
                      width: 300,
                      height: 150,
                      closeOnEscape: false
                  });
          });
      });
  
      function toClipboard(me, msg_id) {
                          ZeroClipboard.setMoviePath('http://davidwalsh.name/dw-content/ZeroClipboard.swf');
                          var clip = new ZeroClipboard.Client();
                          //clip.setHandCursor( true );
                          var txt = $("#msg_p_span_"+msg_id).html();
  
                          console.log("Text: "+txt);
                              clip.addEventListener('mousedown',function() {
                              clip.setText(txt);
                              console.log("Copied");
                              });
                              clip.addEventListener('complete',function(client,text) {
                              alert('copied: ' + text);
                              });
                          clip.glue(me);
                  }
      &lt;/script&gt;
  
  &lt;title&gt;jQuery UI dialog extra demo&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
    &lt;span id="msg_p_span_1" style="display:none;"&gt;Testing the clipboard copy 1.&lt;/span&gt;
    &lt;span title="Copy to clipboard" style="cursor: pointer; text-decoration:underline;" onmouseOver="toClipboard(this, 1)"&gt;Copy&lt;/span&gt;
    &lt;button id="ex1"&gt;Launch dialog&lt;/button&gt;
  
  &lt;div id="div1" style="display:none;"&gt;
  
  &lt;p style="padding: 10px 3px; font-size: 12px;" id="msg_p_2"&gt;
  &lt;span id="msg_p_span_2"&gt;Testing the clipboard copy 2.&lt;/span&gt;
  &lt;span style="float: right; width: 25px; margin-right: 10px;"&gt;
  &lt;span title="Copy to clipboard" style="cursor: pointer; text-decoration:underline;" onmouseOver="toClipboard(this, 2)"&gt;Copy&lt;/span&gt;
  &lt;/span&gt;
  &lt;/p&gt;
  
  &lt;/div&gt;  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>If i click on the first 'Copy' link, the text is getting copied well and an alert is generated. But when i launch the jquery dialog box and click on the 'Copy' link inside it, the text is not copied.</p>
  
  <p>Probably someone can reproduce the issue with the exact above code (copy-paste) and find it.</p>
  
  <p>Note: I am following the core example at <a href="http://davidwalsh.name/clipboard" rel="nofollow">Davidwalsh site</a></p>