Py学习  »  Jquery

在jquery中模拟单击iframe

Alexander • 3 年前 • 303 次点击  

当我点击图片时,我正试图开始播放YouTube视频。我可能只是不知道我应该把点击指向iframe的哪一部分,但无论如何我都被卡住了。

这是我的密码。提前谢谢。

<div id="image">
  <img src="example.png">
</div>
<iframe id="youtube" width="560" height="315" src="https://www.youtube.com/embed/kJQP7kiw5Fk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
$(document).on('click', '#image', function(e) {
    $("#youtube").trigger('click');
});
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/130022
 
303 次点击