悬停在视频上并在手机上触摸😁

问题描述 投票:0回答:0

我正在 webflow 中构建一个投资组合网站,我能够从 CMS 加载视频缩略图并通过鼠标悬停启动视频。

但是在手机上,没有任何反应...... 我知道我有一个“touchstart”功能,但我不知道如何实现。 你们能帮帮我吗? 这是我的脚本:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div style="width: 100%; height: 100%;" class="card">
       <video loop preload="none" loop="" muted="" data-object-fit="cover">
      <source src="https://studio-x.hu/itempics/{{wf {&quot;path&quot;:&quot;thumbnail-link&quot;,&quot;type&quot;:&quot;PlainText&quot;\} }}" type="video/MP4">
    </video>
</div>

<script>
$('.card').hover(hoverVideo, hideVideo);

function hoverVideo(e) {  
        $('video', this)[0].play(); 
        $('.card-top').hide();
    }

    function hideVideo(e) {
        $('video', this)[0].pause();
        $('.card-top').show();
    }
</script>

搜索论坛。 我希望有人能帮助我 :)

hover touch mouse
© www.soinside.com 2019 - 2024. All rights reserved.