Помогите, JS скрипт не работает в IE

Y5
На сайте с 14.07.2009
Offline
119
787

Добрый день!

Помогите пожалуйста, у меня скрипте не работает в IE

Вообщем если подводишь курсор к верху страницы, то выходит сообщение.

Но код этот не работает в IE

$(document).ready(function() {


$(document).mousemove(function(e) {

if(e.pageY <= 20)
{

// Launch MODAL BOX
$('#exit_content').modal({onOpen: modalOpen, onClose: simplemodal_close});
}

});

});

/**
* When the open event is called, this function will be used to 'open'
* the overlay, container and data portions of the modal dialog.
*
* onOpen callbacks need to handle 'opening' the overlay, container
* and data.
*/
function modalOpen (dialog) {
dialog.overlay.fadeIn('fast', function () {
dialog.container.fadeIn('fast', function () {
dialog.data.hide().slideDown('fast');
});
});
}

/**
* When the close event is called, this function will be used to 'close'
* the overlay, container and data portions of the modal dialog.
*
* The SimpleModal close function will still perform some actions that
* don't need to be handled here.
*
* onClose callbacks need to handle 'closing' the overlay, container
* and data.
*/
function simplemodal_close (dialog) {
dialog.data.fadeOut('fast', function () {
dialog.container.hide('fast', function () {
dialog.overlay.slideUp('fast', function () {
$.modal.close();
});
});
});
}
Подписи пока нет :(
Оптимизайка
На сайте с 11.03.2012
Offline
396
#1

IE 7 что-ли?

вместо

if(e.pageY <= 20)

попробуйте

var pageY = (e.pageY) ? e.pageY : (e.clientY+document.body.scrollTop+document.documentElement.scrollTop);

if(pageY <= 20)

⭐ BotGuard (https://botguard.net) ⭐ — защита вашего сайта от вредоносных ботов, воровства контента, клонирования, спама и хакерских атак!
L
На сайте с 07.12.2007
Offline
351
#2

Да в IE нет e.pageX/e.pageY, но его можно эмулировать через e.clientX/e.clientY

Y5
На сайте с 14.07.2009
Offline
119
#3

Ок спасибо, подскажите а как это сделать, у меня с разными вариантами не получается вообще. За помощь отблагодарю!

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий