title: Jquery Youtube Iframe Mouseenter and Mouseleave on hover
body: <p>I have much Videos on the website and i wat on a hover that the hovered iframe play. and on mouseleave it should stop playing.</p>
  
  <p>The hover and play works. But the Mouseleave dont work and i dont know why.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
      $(".youtube").each(function() {
        $(this).css('background-image', 'url(//i.ytimg.com/vi/' + this.id + '/hqdefault.jpg)');
        $(document).delegate('#' + this.id, 'mouseenter', function() {
      if($(this).data('mouseenter')) {
       return;
      }
      $(this).data('mouseenter', true);
  
          var iframe_url = "//www.youtube.com/embed/" + this.id + "?autoplay=1&amp;autohide=1";
          if ($(this).data('params')) iframe_url += '&amp;' + $(this).data('params');
          var iframe = $('&lt;iframe/&gt;', {'allowfullscreen':'allowfullscreen', 'frameborder': '0', 'src': iframe_url})
          $(this).append(iframe);
        });
       var playersrc=$('.youtube').attr('src');
      });
    });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>