stanlemon/jGrowl

how to delay the appearance of notification by certain amount of time?

sachin87 opened this issue · 2 comments

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 -%>
  });

Wrap your call in a function, so setTimeout(function(){ $.jGrowl(); }));

@stanlemon thanks i will try this.