parzol
parzol

Reputation: 57

jQuery and IE7 cross-browser bug

$("body").delegate('area[id=area_kontakt]','mouseover mouseleave', function(e){
if (e.type == 'mouseover') {
    $("#kontakt_tip").css('display','block');
} else {
    $("#kontakt_tip").css('display','none');
}
});

Why this code doesn't work in IE7? In IE8, FF, Ch everything is OK. Any help?

Regards.

Upvotes: 0

Views: 410

Answers (2)

thirtydot
thirtydot

Reputation: 228162

Having examined your site, I've found the cause of the problem.

Nobody could have worked this out without seeing the site, because the problem had nothing to do with the code you've provided in your question.

In functions.js, you have this a few times (I've trimmed it down):

xxx.modal({
    //..
    top: 50, //<---
    /*onOpen: function (xxx) {
        //..
    }*/
});

The problem is that trailing comma; it breaks IE7 and older.

Upvotes: 5

Kyle
Kyle

Reputation: 67194

I'm pretty sure it's because IE7 doesn't support atrribute selectors: [id=area_kontakt], You'll have to use a class name/Id name for IE7 to support it inside your jQuery.

Upvotes: 1

Related Questions