I want to show following code on after every 2 minutes on rightside corner of my page
#notification
= link_to "Tomorrow there are <span>#{@current_user.reminders.size}</span> events".html_safe,events_path
I tried following code but its not working the way i want…
function notification()
{
$("#notification").show("slow").delay(800).fadeout(400);
}
How can i do this?
To perform a function at an interval of 2 minutes use
setInterval:EDIT:
From your comment I’m guessing you want something more like this:
Notice the callback function on the
fadeOutmethod. That tells it to call thenotifyfunction again after 2 minutes.Here’s an example: http://jsfiddle.net/vwtkh/4/