views:

144

answers:

1

I'm using SimpleModal plugin for Jquery and I have a weird problem with Firefox ( other browsers work fine: Chrome, Safari, Opera, IE).

What happens is when I click on the button that launches the modal dialog, before showing the modal (and the fadeIn of the overlay), there is a quick "flicker", less than half a second. (It's longer on my slower PC).

Weird thing is, it didn't happen in Firefox 3.5.2, but when I upgraded to 3.6.3, I got the flicker.

Any ideas?

Here is my code:

$("#popup").modal({
    onOpen: function (dialog) {
        dialog.data.show();
        dialog.container.show();
        dialog.overlay.fadeIn('fast');
    },
    onClose: function (dialog) {
        dialog.data.hide();
        dialog.container.hide();
        dialog.overlay.fadeOut('fast', function() { $.modal.close(); });
    }
});
+1  A: 

In case someone else has this issue, the solution is to have the overlay fade in first in the onOpen callback:

$("#popup").modal({
    onOpen: function (dialog) {
        dialog.overlay.fadeIn('fast');
        dialog.container.show();
        dialog.data.show();
    },
    onClose: function (dialog) {
        dialog.data.hide();
        dialog.container.hide();
        dialog.overlay.fadeOut('fast', function() { $.modal.close(); });
    }
});
Eric Martin