【问题标题】:Iframe in Materialize Carousel Not workingMaterialise Carousel 中的 iframe 不工作
【发布时间】:2017-03-30 04:27:33
【问题描述】:

在 Materialize Carousel 方法中,我插入了 Iframe 以在幻灯片中嵌入 Web 链接,而不是普通图像。在插入 iframe 时,单击切换幻灯片不起作用。

轮播法:

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

非活动幻灯片不可点击。单击时,它们不会被激活。 请帮助我找到解决方案

【问题讨论】:

    标签: javascript html iframe carousel materialize


    【解决方案1】:

    在 iframe 的 style 属性中,添加:

    pointer-events: none;
    

    禁用 iframe 上的点击事件。这将确保点击事件正确地冒泡到 Materialize Carousel 插件。

    【讨论】:

    • 谢谢。它适用于从一个轮播项目移动到另一个项目。但我无法对活动轮播项目进行操作。我拥有的每个 iframe 都有悬停和单击事件。有什么办法可以让它发挥作用吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-04
    • 2014-09-17
    • 1970-01-01
    • 2018-10-12
    • 1970-01-01
    • 2017-12-15
    相关资源
    最近更新 更多