因此,我在添加触摸事件时遇到了一些麻烦,因此我可以让此页面 slider 正常工作。它适用于滚动鼠标和按键,但不适用于移动触摸。请参阅 codepen 链接中的代码......
<p data-height="265" data-theme-id="0" data-slug-hash="EyLWKg" data-default-tab="js,result" data-user="WispProxy" data-embed-version="2" data-pen-title="Gray & White - Skewed Slider with Scrolling" class="codepen">See the Pen <a href="https://codepen.io/WispProxy/pen/EyLWKg/">Gray & White - Skewed Slider with Scrolling</a> by Victor Belozyorov (<a href="https://codepen.io/WispProxy">@WispProxy</a>) on <a href="https://codepen.io">CodePen</a>.</p>
最佳答案
- 确保您有 JQuery
将其添加到您的 JS 文件
$('.codepen a').on('click touch',function(){ $('.codepen a').click(); });
关于javascript - 需要添加触摸事件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47399310/