Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Immediate display mode #160

Closed
darmst3 opened this Issue · 3 comments

3 participants

@darmst3

JQuery Noty is a great plugin! However, I'm having a slight issue trying to use it and would really appreciate an "immediate display" mode.

Currently, when you display a Noty it will initiate an animation to render the actual noty. However, in my usage I would like to display a note and then do a bunch of expensive work. Since this environment is currently single-threaded that means that after creating the noty the browser is busy with the work and never gets to the animation to display the noty. My current workaround for this is to pass a continuation as an afterShow callback which will start the expensive work only after the noty is displayed. However, the problem with this is that it causes an additional delay since the animation can only be set to 100ms or so to actually show up.

Additionally, I want to dismiss this noty when the work is done. However, noty does not currently allow close() from within the afterShow callback. My workaround for this is to manually set "shown" immediately after creating the noty so it is set when the afterShow callback executes.

@blittle

Does it work to just set the default animation time?

$.noty.defaults.animation.speed  = 0;
@darmst3

No, unfortunately when the time was set too low the popup failed to render at all. If that is timing-dependent then there may be a bug/issue there.

@needim
Owner

In v2.3.1 we can use animate.css classes for open and closing animations. Actually you can give custom css classes too for animations. For example:

.open-anim {
    display: block;
}

.close-anim {
    display: none
}

usage;

$.noty.defaults.animation = {
        open: 'open-anim',
        close: 'close-anim'
};

@ErickSkrauch Can you create an example on jsfiddle?

@needim needim closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.