2017-09-26 63 views
0

我正在我的個人網站上工作。 我的網站包含一個youtube iframe。將鼠標懸停時,文檔將停止滾動。即使鼠標懸停在YouTube視頻上,我也希望主文檔繼續滾動。通過Youtube Iframe滾動禁用

<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

+0

還有同樣的問題,並解決了[Vimeo iFrame在Firefox上盜取鼠標滾輪事件](https://stackoverflow.com/questions/31418920/vimeo-iframe-stealing-mouse-wheel-event-on-firefox) – Ashwel

+0

可能[Vimeo iFrame在Firefox上盜取鼠標滾輪事件]的副本(https://stackoverflow.com/questions/31418920/vimeo-iframe-stealing-mouse-wheel-event-on-firefox) – SourceOverflow

回答

0

嘗試包成一個div,並設置div的z索引:10什麼的,所以這將導致不鼠標懸停的iframe,但到div。

+0

我檢查了你的頁面,這不會是加工。你需要做的是,在鼠標懸停iframe時觸發一個JS函數,並計算向下滾動或向上滾動的次數,並動態地將它與當前頁面上方的高度相加。 –