【问题标题】:Change iFrame Content based on Time根据时间更改 iFrame 内容
【发布时间】:2017-10-04 01:58:22
【问题描述】:

我希望嵌入的 livestream.com 链接随时间而变化,但在网站上的一个容器中完成,而不是整个页面。

因此,对于 6AM-8AM,嵌入的内容会加载“livestream.com/video1” 但在上午 8 点到下午 3 点,嵌入的内容会加载“livestream.com/video2”

如果没有完全重定向,这可能吗?我该怎么做?

【问题讨论】:

  • 您正在使用哪种语言开发后端?

标签: javascript html time live-streaming


【解决方案1】:

你会明白的

$(document).ready(function(){
	$('a')[0].click();
});
var randompage = ['https://www.spirithoods.com/pages/dummypage','https://lifehacker.com','http://www.lipsum.com']

setInterval(function() {
rndm=Math.floor(Math.random() * 3) + 0 
  $('a').attr('href',randompage[rndm]);
  $('a')[0].click();
}, 5000);
.iframes{
  width:100%;
  height:400px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a href='https://www.spirithoods.com/pages/dummy-page' target='iframename' class='clickit'>hello</a>
<iframe name='iframename' class='iframes'>

</iframe>

【讨论】:

  • 你有没有得到你的想法或根本没有帮助给我一些回应
猜你喜欢
  • 2013-03-06
  • 2016-02-10
  • 2012-09-28
  • 1970-01-01
  • 1970-01-01
  • 2012-01-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多