Mozilla Firefox在输入元素悬停方面效果不佳 使用typed.js“https://github.com/mattboldt/typed.js/”来创建输入占位符的输入效果当输入悬停时它在所有浏览器中工作得非常好但在Firefox上不起作用
输入悬停时的typed.js代码:
var city = new Typed('#city', {
strings: ['کدوم شهر؟ قم', 'کدوم شهر؟ تهران', 'کدوم شهر؟ مشهد', 'کدوم شهر؟ اصفهان', 'کدوم شهر؟ یزد',
'کدوم شهر؟ شیراز', 'کدوم شهر؟ کیش', 'کدوم شهر؟ تبریز'
],
typeSpeed: 40,
backSpeed: 40,
backDelay: 1000,
smartBackspace: true,
loop: true,
bindInputFocusEvents: true,
attr: 'placeholder'
});
city.destroy();
$("#city").attr("placeholder", "کدوم شهر؟");
$("#city").hover(function () {
city.reset();
}, function () {
city.destroy();
$("#city").attr("placeholder", "کدوم شهر؟");
});