使用 Typed.js jQuery 插件,我一直在尝试让闪烁的光标出现在表单输入中。我试过弄乱它,甚至完全复制我在网上找到的示例,但它仍然出现在表单输入之外。有任何想法吗?
这是一个显示问题的 fiddle :
http://jsfiddle.net/dunphyben/1pp3x3au/1/
$(function(){
$(".form-control").typed({
strings: ["Web Developer", "Graphic Designer", "Mobile Developer", "Road Warrior", "DevOps", "Real Estate Agent", "Accountant", "Product Manager", "CEO"],
attr: "placeholder",
typeSpeed: 100
});
});
最佳答案
删除闪烁的 css 动画并使用引号添加一个空字符串,如下所示:
,," 在循环结束时,您将看到一个闪烁的光标。$(function(){
$(".form-control").typed({
strings: ["Web Developer", "pimp", ""],
attr: "placeholder",
typeSpeed: 100
});
});
更新 fiddle http://jsfiddle.net/1pp3x3au/16/
关于javascript - 无法在表单输入中获取 Typed.js 闪烁光标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27681211/