0

SimpleModal 站点中启用动画的示例具有以下动画:

1. Fade in the overlay
2. Slide down the modal div

这是代码:

$("#the-div").modal({
onOpen: function (dialog) {
    dialog.overlay.fadeIn('fast', function () {
        dialog.data.hide();
        dialog.container.show('fast', function () {
            dialog.data.slideDown('fast');
        });
    });
}});

我想要这个动画:

1. Just display the modal
2. Fade in the overlay

唉,简单地从上面的代码中删除第二个参数是dialog.overlay.fadeIn()行不通的。我还尝试删除 的参数dialog.container.show(),也将其更改为dialog.container.open(). 我尝试了其他代码组合,但无济于事。

如何实现我想要的动画?

4

1 回答 1

3

你可以这样做:

$("#the-div").modal({
  onOpen: function (dialog) {
    dialog.data.show();
    dialog.container.show();
    dialog.overlay.fadeIn('fast');
  }
});

由于您只想显示它,请完全删除回调并同时在叠加层上显示modal并启动 a .fadeIn():)

于 2010-06-07T13:34:22.233 回答