当您按下键盘上的“ Enter”键时,更改IFRAME地址

时间:2018-06-27 12:20:18

标签: javascript html css

我创建了带有两个IFRAME窗口的HTML页面。

我想在按下“ Enter”键时更改它们之间的地址。 谢谢!

<body style="background-color:black;">
<iframe class="g" src="www.example.com"  scrolling="no" frameborder="0"  height="100%" width="100%" allowfullscreen></iframe>
<div id="overlay"><iframe src="www.wow.com" scrolling="no" frameborder="0" marginheight="0px"  height="205px" width="360px" allowfullscreen></iframe>
<style>  #overlay {
  position: absolute; 
  top: 430px;
      right: 15px;

  color: #FFF; 
  text-align: center;
  font-size: 20px;
  width: 400px;
  padding: 10px 0;
  z-index: 2147483647;
}

.g {
    height: 100%;
}

#v {
  z-index: 1;
}</style></div><div style='text-align: right;position: fixed;z-index:9999999;bottom: 0; width: 100%;cursor: pointer;line-height: 0;display:block !important;'></div></body>

1 个答案:

答案 0 :(得分:-1)

在此处应用Javascript。

提交/单击输入键时,您必须设置iframe广告代码的src属性。

相关问题