Avoid scroll-wheel hijack by embedded youtube / flash video

て烟熏妆下的殇ゞ 提交于 2019-12-06 02:45:14
<param name="wmode" value="transparent" />

(and the equivalent in embed)

This is a guess. I have personal experience though that if you set this in IE, it will prevent Flash from capturing the arrow buttons for scrolling, which seems related.

This is the only issue I could've found for this matter. I've managed to kinda fix this with a hack.

I've wrapped my embedded content in a div and added an overlay with z-index, like so:

<div class="flash-wrapper">
    <div class="overlay"></div>
    <object>
        My object code goes here
    </object>
</div>

Then, with css

.flash-wrapper {
    max-width: 100%; /*For responsiveness purposes*/
    overflow: hidden; /*To wrap around everything inside*/
    position: relative;
}
.flash-wrapper object {
    /*to fully fill the wrapper - optional*/
    width: 100%;
    max-width: 100%;
    height: auto;
}
.overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    /*The following only applies when the object is declared after the overlay. The overlay needs a higher z-index number*/
    z-index: 100;
}

Now I can scroll on top of the flash as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!