Swipe not working with iframe slide. How fixed?
See original GitHub issue<div class="js-slider" data-items="1" data-dots="true" data-arrows="true" data-mobile-arrows="false">
<div class="video">
<div id="slide" class="video__wrapper">
<iframe class="video__iframe-vimeo" src="//player.vimeo.com/video/108117" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
</div>
<div class="video">
<div id="slide" class="video__wrapper">
<iframe class="video__iframe-vimeo" src="//player.vimeo.com/video/108117" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
</div>
<div class="video">
<div id="slide" class="video__wrapper">
<iframe class="video__iframe-vimeo" src="//player.vimeo.com/video/108117" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
</div>
</div>
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Carousel swipe not working for iframe video - Stack Overflow
The proplem is iframe video click over swipe event. Basically, i will try to fix it via overlay and simple js. here is...
Read more >Vimeo video (iframe) in Carousel: Swipe not working on mobile
Hi, I used the code below to have centered full size vimeo embeds in my website's carousels. When on mobile, the slides with...
Read more >How To Create Responsive Iframes - W3Schools
Learn how to create responsive iframes with CSS. Responsive Iframes. Create an iframe that will keep the aspect ratio (4:3, 16:9, etc.) when...
Read more >ZOHO iFrame codes for PPTS are not working in Mobile ...
I am able to scroll through the slides of the PPT using the left & right button of the keyboard. But when I...
Read more >Prototype scrolling with overflow behavior - Figma Help Center
Animated image showing a horizontal scroll on a slider section of a prototype in ... It's not possible to position scrolling objects above...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone coming across this, the transparent overlay worked for me and can be done via pure CSS. Just add this snippet that targets the element that contains your iframe:
.iframe-container-div::after { content: ""; background: transparent; width: 100%; height: 100%; min-height: 1px; position: absolute; top: 0; }
The only catch is that it will prevent other events from triggering inside the iframe by default
@bhar4t Its been a little while since I initially commented… But if I recall correctly, it probably won’t work 100% out-the-box since the overlay would receive any click events (this may vary by browser version). If you need to access controls inside of the iFrame you may have to get creative.
In our case, we had a custom “Play” button in the overlay and re-launched the iframe in a lightbox after a click event. (This relaunching was part of a library that was actually cloning the element rather than creating a duplicate)
So we only needed to handle click events on the slide to launch the lightbox (which would have the full controls) and then any swipe/drag/etc events would operate as normal on the slider.