how to delay the appearance of notification by certain amount of time?
sachin87 opened this issue · 2 comments
sachin87 commented
how to delay the appearance of notification by certain amount of time, say i want to display notification 10 seconds? i tried to use setTimeout JavaScript function but it does not seems to work.
Here is my code(its Ruby/ROR code):
<% @site.notifications.active.each do |notification| -%>
setTimeout($.jGrowl('<%= notification.message %>',
{ header: '<%= notification.header %>',
life: '<%= notification.life %>',
position: '<%= notification.position %>',
corners: '<%= notification.corners %>px'}),10000);
<% end -%>
});
stanlemon commented
Wrap your call in a function, so setTimeout(function(){ $.jGrowl(); }));
sachin87 commented
@stanlemon thanks i will try this.