【问题标题】:Scrolling Disable over a Youtube Iframe在 Youtube iframe 上滚动禁用
【发布时间】:2018-03-07 12:03:27
【问题描述】:

我正在开发我的个人网站。 我的网站包含一个 youtube iframe。当鼠标悬停在它上面时,文档停止滚动。即使鼠标悬停在 youtube 视频上,我也希望主文档继续滚动。

<div class="video-container"><iframe width="950" height="480" style="margin-top: 10px" src="https://www.youtube.com/embed/fL3QKagSn1s#t=0m00s" scrolling="no" frameborder="0" allowfullscreen/></iframe></div>
            </div>

enter link description here

【问题讨论】:

标签: javascript jquery html iframe youtube


【解决方案1】:

尝试将其包装到一个 div 中并设置该 div 的 z-index:10 或其他东西,这样这将导致鼠标悬停到 iframe 而不是 div。

【讨论】:

  • 我检查了您的页面,这将无法正常工作。你需要做的是,当鼠标悬停在 iframe 上时触发一个 JS 函数,并计算向下或向上滚动了多少,然后将它与页面的当前高度相加。
猜你喜欢
  • 2013-03-07
  • 1970-01-01
  • 2015-10-22
  • 2017-03-31
  • 2017-10-12
  • 2011-02-12
  • 2018-10-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多