question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 8 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
mattLummuscommented, Sep 26, 2018

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

1reaction
mattLummuscommented, Feb 26, 2019

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found