title: How to replace OWL Carousel image with embed code on click event
body: <p>I am using <a href="http://owlgraphic.com/owlcarousel/" rel="nofollow">OWL Carousel</a> to display projects and now I want to replace this embed code to clicked image:</p>
  
  <pre><code>&lt;embed src="http://sample.biz/scratch.swf" wmode="direct" quality="high" flashvars="project_filePath=http://sample.biz/public/upload/scratchproject/2016/02/Ignition.sb2" width="480px" height="400px" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"&gt;
  </code></pre>
  
  <p>I want show embed code when user click to any of the images.</p>
  
  <p>Any Idea how to do this with <code>OWL Carousel</code>. </p>
  
  <p><strong><a href="http://jsfiddle.net/L0p5as86/2/" rel="nofollow">My JSFiddle</a></strong>.</p>
  
  <h2><strong>HTML Part:</strong></h2>
  
  <pre><code>&lt;div id="example" class="carousel"&gt;
    &lt;div class="item"&gt;
      &lt;img src="http://dummyimage.com/vga" alt="" /&gt;
    &lt;/div&gt;
    &lt;div class="item"&gt;
      &lt;img src="http://dummyimage.com/vga" alt="" /&gt;
    &lt;/div&gt;
    &lt;div class="item"&gt;
      &lt;img src="http://dummyimage.com/vga" alt="" /&gt;
    &lt;/div&gt;
    &lt;div class="item"&gt;
      &lt;img src="http://dummyimage.com/vga" alt="" /&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <h2>jQuery Part:</h2>
  
  <pre><code>var currentIndex = 0;
  $(document).ready(function() {
  
    $("#example").owlCarousel({
      items: 5,
      singleItem: true,
      afterMove: function() {
        currentIndex = this.currentItem;
      }
    }).on('changed.owl.carousel', function(property) {
      currentIndex = property.item.index;
      console.log(currentIndex);
    });
  
  });
  
  $(document.body).on('click', '#example .item img', function() {
    var embedData = '&lt;embed src="http://sample.biz/scratch.swf" wmode="direct" quality="high" flashvars="project_filePath=http://sample.biz/public/upload/scratchproject/2016/02/Ignition.sb2" width="480px" height="400px" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"&gt;';
  });
  </code></pre>