bootstrap-notify icon indicating copy to clipboard operation
bootstrap-notify copied to clipboard

Timer apparently not working

Open brunoaugusto opened this issue 8 years ago • 3 comments

I was about to go through all the overhead to create a more modest version of the feature provided by your plugin when I decided to search for one ready to use first and luckily I found it.

But after reading the documentation and implementing it I noticed that, apparently, the timer option is not working.

My intention would be to set a dynamic value based on the number of words in the message. A "normal" human being has a wpm (words per minute) in a range of 200 ~ 230 but because I'm such a nice guy I give 50% more of that:

In code, that would be:

$.notify({
    'message': message
},{
    // ...
    'timer': Math.round( ( 60000 * message.split( ' ' ).length ) / 115 ),
    // ...
});

Being message a function argument I'm using to wrap everything up

For a short message with 6 words this reports me 3130ms but when measuring the time, even if only approximately, the message is visible for like 8 seconds.

Thinking my math could be the problem I defined it as just 100ms (without the 'ms', of course) and the box was still visible for ~8s

Is anything wrong or, maybe, the fact I am using onShow() and onClose() for additional procedures could be increasing the time (unlikely but...)

brunoaugusto avatar Jun 13 '17 20:06 brunoaugusto

Got my interested peeked. I'll check this out

On Tue, Jun 13, 2017, 16:03 Bruno Augusto [email protected] wrote:

I was about to go through all the overhead to create a more modest version of the feature provided by your plugin when I decided to search for one ready to use it first and luckily I found it.

But after reading the documentation and implementing it I noticed that, apparently, the timer option is not working.

My intention would be to set a dynamic value based on the number of words in the message. A "normal" human being has a wpm (words per minute) in a range of 200 ~ 230 but because I'm such a nice guy I give 50% more of that:

In code, that would be:

$.notify({ 'message': message },{ // ... 'timer': Math.round( ( 60000 * message.split( ' ' ).length ) / 115 ), // ... });

Being message a function argument I'm using to wrap everything up

For a short message with 6 words this reports me 3130ms but when measuring the time, even if only approximately, the message is visible for like 8 seconds.

Thinking my math could be the problem I defined it as just 100ms (without the 'ms', of course) and the box was still visible for ~8s

Is anything wrong or, maybe, the fact I am using onShow() and onClose() for additional procedures could be increasing the time (unlikely but...)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mouse0270/bootstrap-notify/issues/166, or mute the thread https://github.com/notifications/unsubscribe-auth/AAieis_DRvXFMrIrFWSn_fPULyprDBpkks5sDusKgaJpZM4N5Avj .

mouse0270 avatar Jun 13 '17 22:06 mouse0270

I have similar problem. I set any number to property timer but without any difference. Any progress in this issue?

topolanekmartin avatar Jun 29 '19 17:06 topolanekmartin

Also experiencing this issue @mouse0270

xwiz avatar Jun 21 '20 13:06 xwiz