css - 简单模式弹出窗口适用于除 IE8 和 IE9 以外的所有浏览器

标签 css jquery-ui jquery jquery-plugins

我正在使用此 div 使用 jquery 打开退出弹出窗口。但在 IE8 和 IE9 中不显示。

这是div:

<div style="display: none; padding: 10px;" id="exit_content">
    <h3>10% Discount on purchase of this item!</h3><br />
</div>

这两个函数用于在鼠标移动时打开和关闭弹出窗口。

function modalOpen (dialog) {
    dialog.overlay.fadeIn('fast', function () {
        dialog.container.fadeIn('fast', function () {
            dialog.data.hide().slideDown('fast');
        });
    });
}

function simplemodal_close(dialog) {
    dialog.data.fadeOut('fast', function () {
        dialog.container.hide('fast', function () {
            dialog.overlay.slideUp('fast', function () {
                $.modal.close();
            });
        });
    });
}

这里是用于打开和关闭的脚本。

$(document).mousemove(function(e) {
     if(e.pageY <= 5) {
         // Launch MODAL BOX
         $('#exit_content').modal({onOpen: modalOpen, onClose: simplemodal_close});
     } 
 });

此弹出窗口显示在除 IE8 和 IE9 之外的所有浏览器中。

最佳答案

$(document).mousemove(function(e) {
     if(e.pageY <= 5) {

这可能是 IE8 和 IE9 中的问题,尝试调试并查看 IE 将什么作为 e 的值传递

我不认为 pageY 会出现在旧的 IE

关于css - 简单模式弹出窗口适用于除 IE8 和 IE9 以外的所有浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16744096/

相关文章:

javascript - JQuery 在图像悬停时显示标题标签内容,可能吗?

jquery - 使用 jQuery 动态调整三列设计

php - 不使用 php 的电子邮件表单提交

javascript - 在整个站点上设置 JQuery UI 日期选择器的默认值

javascript - 使用 jQuery 检测何时在 div 中单击按钮

javascript - 使用 jQuery 读取 JSON 并通过 ID 匹配字段

javascript - 从 window.onbeforeunload 中排除 DIV 内的点击

html - 如何在媒体查询中定义所有低于和高于1366的分辨率?

javascript - Knockout JS + JQuery UI - 在重新排序后从可观察数组中删除项目的问题

jquery - jquery 字符串中的第一个单词