简体   繁体   English

移动设备上的 Typed.js 故障

[英]Typed.js glitch on mobile

I'm using Typed.js and there is a glitch when viewed on Safari on some mobile phones.我正在使用 Typed.js 并且在某些手机上的 Safari 上查看时出现故障。 It looks fine on my phone (iPhone SE), but my client sees this on her iPhone 6:在我的手机 (iPhone SE) 上看起来不错,但我的客户在她的 iPhone 6 上看到了这个:

https://drive.google.com/open?id=1RrPRB1LfrqidOo6b9cTUhHq6Mv7LKLWJ https://drive.google.com/open?id=1RrPRB1LfrqidOo6b9cTUhHq6Mv7LKLWJ

It is difficult to figure out what is causing the issue since I don't see anything wrong on my end.很难弄清楚是什么导致了问题,因为我没有看到任何问题。 I am using the Typed.js CDN and here is my code:我正在使用 Typed.js CDN,这是我的代码:

<div class="typed_wrap">
  <p><span class="typed"></span></p>
</div>

<script>
  $( document ).ready(function() {
    $(function(){
        $(".typed").typed({
            strings: ["Is it possible to scale my marketing with podcasts?", "What types of podcasts best reach my target audience?", "How should I craft my message for podcast host reads?", "How do I know where to place my ads within the podcast content for maximum effectiveness?", "How do I get an experienced marketing team to manage and optimize my campaign?"],
            stringsElement: null,
            typeSpeed: 5,
            startDelay: 1000,
            backSpeed: 1,
            backDelay: 2000,
            loop: true,
            showCursor: false,
            cursorChar: "|",
            attr: null,
            contentType: 'html',
            callback: function() {},
            preStringTyped: function() {},
            onStringTyped: function() {},
            resetCallback: function() {}
        });
    });
  });

</script>

Am I initializing it wrong?我初始化错了吗? I have tried Googling it and I cannot find anyone else who has had this specific problem.我试过在谷歌上搜索它,但找不到其他遇到过这个特定问题的人。 Thanks in advance!提前致谢!

This is related to animation behavior in Webkit, I guess.我猜这与 Webkit 中的动画行为有关。

Try to add the following class to the parent block element of span#typed :尝试将以下类添加到span#typed的父块元素:

.stop-flicking-around {
  -webkit-transform:translate3d(0,0,0);
}

Source: iPhone WebKit CSS animations cause flicker来源: iPhone WebKit CSS 动画导致闪烁

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

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