0
有沒有人有一個想法來處理滑塊中的iframe視頻/音頻,並獲得可能性刷卡並仍然通過單擊它來播放它?Iframe Video(Youtube)swipe
我試圖把覆蓋在iframe和調度事件的iframe但它不似乎工作: -/
這裏是我以前的嘗試: http://codepen.io/Anddo0/pen/PwOWxZ
的js部分:
var iFrameContainer = document.querySelector('#iFrameContainer');
var overlay = document.querySelector('#overlay');
if(iFrameContainer && overlay){
overlay.addEventListener('click', function(){
console.log('Add event on Overlay');
// We transfer the event click to the iframe
event.target.nextElementSibling.dispatchEvent(cloneMouseEvent(event));
});
iFrameContainer.addEventListener('click', function(){
console.log('Click in IframeContainer');
});
}
function cloneMouseEvent(e) {
var evt = document.createEvent("MouseEvent");
evt.initMouseEvent(e.type, e.canBubble, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);
return evt;
}
HTML:
<div style='position: relative; height:300px; width:300px;'>
<div id='overlay' style='width:100%; height:100%; margin-bottom: 20px; height: 100%; position: absolute; overflow: hidden; z-index: 10;'></div>
<div id='iFrameContainer' style="left: 0px; width: 100%; height: 100%; z-index:9;">
<iframe allowfullscreen="true" frameborder="0" mozallowfullscreen="true" src="//www.youtube.com/embed/wTcNtgA6gHs?feature=oembed " style="top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;" webkitallowfullscreen="true">
</iframe>
</div>
具有u嘗試使用插件如:https://github.com/layalk/FlexSlider – abhiklpm 2015-02-09 09:57:43
其實我用現在的swipper重寫版本的https://github.com/thebird/Swipe 我看着你的插件,看起來他們得到了同樣的問題: http://flexslider.woothemes.com/video.html看看這個頁面的移動視圖和嘗試 刷在Vimeoh視頻不工作。 – Anddo0 2015-02-09 10:02:07