如何增加typed.js打字效果的光标大小

huangapple go评论130阅读模式
英文:

How do i increase the size of the typed.js typing symbol

问题

打字符号在typed.js中太小了。我如何调整它?

我找不到任何可以更改打字符号大小/比例的选项。

此外,这是typed的代码。如果您知道答案,请相应地调整代码。

var typed = new Typed('#typing', {
    strings: ['程序员', '游戏开发者', '网页开发者', '玩家', '设计师'],
    typeSpeed: 100,
    loop: true,
    backSpeed: 100,
});

如何增加typed.js打字效果的光标大小

英文:

The typing symbol is too small in typed.js. How do I adjust this?

如何增加typed.js打字效果的光标大小

I couldn't find any options that change the size/scale of the typing symbol

Also here is the typed code. Kindly adjust the code accordingly if you know the answer

var typed = new Typed('#typing', {
    strings: ['Programmer', 'Game Developer', 'Web Developer', 'Gamer', 'Designer'],
    typeSpeed: 100,
    loop: true,
    backSpeed: 100,
});

答案1

得分: 0

你可以为 typed-cursor 类添加与打字元素相同的 font-size 样式。

.typed-cursor {
  font-size: 2em;
}

请注意,上述代码中的 CSS 部分已被翻译。

英文:

You can style the typed-cursor class to give it the same font-size as the typing element.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

new Typed(&#39;#typing&#39;, {
    strings: [&#39;Programmer&#39;, &#39;Game Developer&#39;, &#39;Web Developer&#39;, &#39;Gamer&#39;, &#39;Designer&#39;],
    typeSpeed: 100,
    loop: true,
    backSpeed: 100,
});

<!-- language: lang-css -->

#typing {
  font-size: 2em;
}
.typed-cursor {
  font-size: 2em;
}

<!-- language: lang-html -->

&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.10/typed.js&quot; integrity=&quot;sha512-tQQXRDB2wEmuJGtFrmmoFYzNTq8StA1XJrfO0OQbbTxd9G0CwaTDL6/C1y805IlvBVrMwOqob1kf6r/2U5XXVg==&quot; crossorigin=&quot;anonymous&quot; referrerpolicy=&quot;no-referrer&quot;&gt;&lt;/script&gt;
&lt;span id=&quot;typing&quot;&gt;&lt;/span&gt;

<!-- end snippet -->

huangapple
  • 本文由 发表于 2023年7月13日 23:46:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76681232.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定