jQuery悬停在Firefox浏览器

时间:2017-11-21 12:34:15

标签: jquery firefox browser hover typed.js

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", "کدوم شهر؟");
  });

这是在chrome浏览器上: this show js on chrome browser

这是在mozilla firefox浏览器上(不能正常工作): gif show js on firefox browser

0 个答案:

没有答案