Typed.js和Fontawesome

时间:2016-04-22 14:36:07

标签: javascript font-awesome typed.js

是否可以让typed.js与fontawesome一起使用,以便例如输入一个推特图标?

1 个答案:

答案 0 :(得分:1)

你试过这个吗?

小提琴:https://jsfiddle.net/4L9a8z5w/

代码:

$(".element").typed({
strings: ["<i class='fa fa-camera' /> is prohibited <i class='fa fa-ban'></i><i class='fa fa-camera' /> is prohibited <i class='fa fa-ban'></i><i class='fa fa-camera' /> is prohibited <i class='fa fa-ban'></i><i class='fa fa-camera' /> is prohibited <i class='fa fa-ban'></i><i class='fa fa-camera' /> is prohibited <i class='fa fa-ban'></i><i class='fa fa-camera' /> is prohibited <i class='fa fa-ban'></i><i class='fa fa-camera' /> is prohibited <i class='fa fa-ban'></i><i class='fa fa-camera' /> is prohibited <i class='fa fa-ban'></i>"],
typeSpeed: 0,
contentType: 'html'
})

您必须将contentType设置为'html',以便fontawesome可以正常工作。