jQuery代码获胜'不适用于IE8,但适用于IE9

jQuery code won't work on IE8, but does on IE9

本文关键字:适用于 IE8 IE9 不适用 代码 获胜 jQuery      更新时间:2023-09-26

我做了一些jQuery,使我的导航下拉,在悬停时显示和隐藏。出于某种奇怪的原因,它在IE8和IE7上不起作用。

当用Console.log()测试时,它在悬停时正确执行,但$('div', this).show();部分。。。

我的jQuery版本是:v1.9.1

我的代码

$("nav ul li").hover(
  function () {
    $('div', this).show();
  },
  function () {
     $('div', this).hide();
  }
);

试试这个:

  $(".class").on('mouseenter', your_function);

使用旧的jQuery版本在ie6+中获得适当的支持

请在此处查看。

http://jquery.com/browser-support/