javascript - ie9中光标跳到元素上方

标签 javascript html asp.net-mvc-3 internet-explorer google-chrome

在我的 MVC3 应用程序中,当鼠标悬停在元素上方时,我会切换光标。

这是 JavaScript 代码:

$('#print').hover(function () {
    var cursorUrl = 'url(@Url.Content("~/Content/img/print_24.ico")), auto';
    $(this).css('cursor', cursorUrl);
});

问题是:谷歌浏览器以应有的方式显示它。光标悬停并且图标显示在鼠标位置上。但 Internet Explorer 在链接上方 0.5 - 1 厘米处显示光标图标。我测试过 browsermodus IE7、IE8 和 IE9。但图标始终位于链接上方。

提前致谢。

最佳答案

我在使用 .cur 光标文件时解决了这个问题(它在 Chrome 和 Firefox 中也能正确显示)。

为了创建这些 cur 文件,我使用了 RealWorld Cursor Designer

关于javascript - ie9中光标跳到元素上方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13138518/

相关文章:

javascript - 在 AngularJS 中使用 jQuery Mobile Adapter - 应用 jqmCompatMode false 以启用 Angular 路由

javascript - 在 setTimeout 中设置 CSS 不更新

javascript - jQuery 在 4 个 div 之间切换

html - 当悬停 p 元素时尝试显示 div 元素时,我的 CSS 无法正常工作

asp.net-mvc - 在mvc中使用ajax调用重定向到另一个 View

javascript - 关于 : jquery. js :2 Uncaught Error: Syntax error, 无法识别的表达式 : #mobile-menu-toggle, #mobile-menu a[href*=#]

javascript - JQuery 克隆 div 同时删除内部 img div src

javascript - 我如何使用 Intel XDK 保持屏幕打开

jquery - 在 MVC 中将数据从 Jquery 加载到表中

jquery - 如何在 MVC3 中使用 Ajax 编写 HTML.RenderPartial 刷新代码?