0

So, I've got SimpleModal working like I want it to except in IE7.

What's the problem? It just doesn't show up at all.

I have two types of modals going on.

First one:

$('.calendar-button').click(function (e) {
        $('.calendar-container').modal({
            overlayClose: true,
        });
        return false;
    });

Second one:

$('.tv-list li a').click(function (e) {
    e.preventDefault();
    $('#info-' + this.id).modal(
        {onOpen: function (dialog) {
            dialog.overlay.fadeIn('fast', function () {
                dialog.container.slideDown('fast', function () {
                    dialog.data.fadeIn('fast');
                });
            });
        },
        overlayClose: true,
    });
    return false;
});

And none of these seems to be working. For both of windows that, should, be popping up i have the same basic style of

display:none;

But, none of these work in IE7. Any thoughts? All of them are in the document ready thingy.

Dennis
  • 47
  • 1
  • 8

1 Answers1

1

, is your problem. IE7 doesn’t like trailing commas in objects. Try changing overlayClose: true, to overlayClose: true

The final code would look like this:

$('.calendar-button').click(function (e) {
    $('.calendar-container').modal({
        overlayClose: true
    });
    return false;
});
Allan Kimmer Jensen
  • 4,333
  • 2
  • 31
  • 53
Robin Whittleton
  • 6,159
  • 4
  • 40
  • 67
  • That did it. Definately saving that down somewhere to be remembered. – Dennis Apr 16 '12 at 12:23
  • It’s also worth remembering that while trailing commas don’t automatically break arrays in IE8 they do break the length property (e.g. `[1,2,3,].length == 4` is true in IE8. That got fixed in IE9. If this answer has helped could you accept it? Thanks! – Robin Whittleton Apr 16 '12 at 12:26
  • Good to know! I have accepted the answer, you were to quick so I had to wait 10 minutes before I could do it. – Dennis Apr 16 '12 at 12:35