本文介绍了Youtube延迟自动开始视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
无论如何都可以延迟 youtube 视频的自动启动,例如:页面加载后 20 秒?"
There is anyway to delay the auto start of a youtube video for example:" 20seconds, after page loads?"
这里是自动启动的例子:
Here is the example just with the auto start:
http://jsfiddle.net/qbqEA/
谢谢
推荐答案
这不是完美的解决方案,但它确实有效,
It is not perfect solution but it works,
<iframe class="delayed" width="486" height="273" frameborder="0" data-src="__url__" allowfullscreen=""></iframe>
请注意,我使用 data-src 而不是 'src'
note that I used data-src instead of 'src'
$(document).ready(function() {
setTimeout(function() {
$('iframe.delayed').attr('src',
$('iframe.delayed').attr('data-src'));
}, 20000);
}
它会在页面加载后 20 秒加载 iframe.看我的叉子:http://jsfiddle.net/WswGV/
It will load iframe 20 seconds after page loads. see my fork: http://jsfiddle.net/WswGV/
这篇关于Youtube延迟自动开始视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!