Javascript Jquery显示隐藏不';我根本不在手机上工作

Javascript Jquery显示隐藏不';我根本不在手机上工作,javascript,jquery,css,Javascript,Jquery,Css,我正在做一个小型的俄语项目,我需要一个手机版网站的帮助 php8098.github.io/早餐 问题出在播放Button的第一个滑块上,它必须打开模式窗口 请帮助我,我需要在明天之前修复这个错误,如果我像一个非常愚蠢的人一样写我的问题,我很抱歉 以下是jquery代码 $('.button-play-1').on("click", function(){ $('.video-popup-1').show() }); $('.close-1').on("click", f

我正在做一个小型的俄语项目,我需要一个手机版网站的帮助 php8098.github.io/早餐

问题出在播放Button的第一个滑块上,它必须打开模式窗口 请帮助我,我需要在明天之前修复这个错误,如果我像一个非常愚蠢的人一样写我的问题,我很抱歉

以下是jquery代码

$('.button-play-1').on("click", function(){
    $('.video-popup-1').show()
    });
    $('.close-1').on("click", function(){
    $('.video-popup').hide()
    });
这是html

           <div class="feedback-slider">
                <div class="feedback-slide feedback-slide-1">
                    <button class="button-play button-play-1">
                    <img src="img/play.png" alt="">
                    </button>
                </div>
                <div class="feedback-slide feedback-slide-2">
                    <button class="button-play button-play-2">
                    <img src="img/play.png" alt="">
                    </button>
                </div>
                <div class="feedback-slide feedback-slide-3">
                    <button class="button-play button-play-3">
                    <img src="img/play.png" alt="">
                    </button>
                </div>
                <div class="feedback-slide feedback-slide-4">
                    <button class="button-play button-play-4">
                    <img src="img/play.png" alt="">
                    </button>
                </div>
                <div class="feedback-slide feedback-slide-5">
                    <button class="button-play button-play-5">
                    <img src="img/play.png" alt="">
                    </button>
                </div>
                <div class="feedback-slide feedback-slide-6">
                    <button class="button-play button-play-6">
                    <img src="img/play.png" alt="">
                    </button>
                </div>
            </div>
            <!-- /.feedback-slider -->
        <div class="video-popup video-popup-1">
        <div class="popup">
            <iframe width="380" height="403" src="https://www.youtube.com/embed/B3DP2rwQmpI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
            <div class="close close-1">
            <img src="img/close.png" alt=""></div>
        </div>
    </div>

我也面临同样的问题,我的IOS设备无法检测到点击按钮或图标

所以我尝试内联属性
onclick

试试这个,可能会有帮助:)


PS:当我面对这个问题时,这是我找到的唯一一个解决方案

做了一个快速测试,效果很好。您是否将jQuery代码放入
$(function(){--code here--})中
确保它只在文档准备好时执行?我有这个功能嘿,在
slick
初始化反馈部分后注册你的点击事件我尝试一下,但它不起作用这很奇怪,在firefox mobile视图中,点击确实不起作用,但是在dev控制台中手动注册click事件可以使它再次工作。有什么要取消注册的吗?(我猜是史瑞克造成的)非常感谢,你帮了我
.video-popup {
  position: fixed;
  display: none;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  background-color: rgba(0, 0, 0, 0.8);
}
.popup {
  position: fixed;
  left: 50%;
  top: 7%;
  width: 420px;
  height: 550px;
  -webkit-transform: translateX(-50%);
  -ms-transform: translateX(-50%);
  transform: translateX(-50%);
  background: #fff;
  border-radius: 10px;
}

.popup iframe {
  margin-left: 20px;
  margin-top: 70px;
}

.close {
  position: absolute;
  right: -10px;
  top: -15px;
  font-size: 35px;
  color: #000;
  font-weight: 300;
  cursor: pointer;
  width: 36px;
  height: 36px;
  -webkit-box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  background-color: #ffffff;
  text-align: center;
  line-height: 30px;
  border-radius: 50%;
}