简体   繁体   English

Materialise Carousel中的iframe无法正常工作

[英]Iframe in Materialize Carousel Not working

In Materialize Carousel method instead of normal images, I have inserted Iframe to embed a web link in slides. 在Materialize Carousel方法而不是普通图像中,我插入了iframe以将Web链接嵌入幻灯片中。 On inserting Iframes, clicking to switch slide doesn't work. 插入iframe时,单击以切换幻灯片不起作用。

Carousel Method: 轮播方法:

<div class="carousel">
    <a class="carousel-item"> <iframe style=' max-height: 700px; max-width: 420px; width: 340px; height: 566px;' src='http://www.website.com' frameborder='0' allowfullscreen scrolling='no'></iframe></a>
    <a class="carousel-item"> <iframe style=' max-height: 700px; max-width: 420px; width: 340px; height: 566px;' src='http://www.website.com' frameborder='0' allowfullscreen scrolling='no'></iframe></a>
    <a class="carousel-item"> <iframe style=' max-height: 700px; max-width: 420px; width: 340px; height: 566px;' src='http://www.website.com' frameborder='0' allowfullscreen scrolling='no'></iframe></a>
    <a class="carousel-item"> <iframe style=' max-height: 700px; max-width: 420px; width: 340px; height: 566px;' src='http://www.website.com' frameborder='0' allowfullscreen scrolling='no'></iframe></a>
</div>

The non active slides are not clickable. 非活动幻灯片不可单击。 On clicking, they don't get activated. 单击时,它们不会被激活。 Kindly help me find a solution 请帮助我找到解决方案

In the iframe's style attribute, add: 在iframe的style属性中,添加:

pointer-events: none;

to disable click events on the iframe. 在iframe上禁用点击事件。 This will make sure click events correctly bubble up to the Materialize Carousel plugin. 这将确保单击事件正确地冒泡到Materialize Carousel插件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM