My countdown plugin in JQuery


Hello, this is a very simple plugin that do some countdown for you.You can send two parameter. First one is the time in seconds where the countdown start and second is a callback function that after complete the countdown what you want to do written in here.
As you can see i create a pop up box to notify that the countdown is just end.So alert will be shown to user after the countdown comes to an end.


<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”&gt;
<html xmlns=””&gt;
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
<script type=”text/javascript” src=”jquery.js”></script>
<script type=”text/javascript” src=”plugin2.js”></script>
<script type=”text/javascript”>


alert(‘End of countdown!’);


<span id=”spa”></span>




$.fn.countdown = function(time,func)

start = time;
function count()
start -=1;
if(start == 0){
time_interval = setInterval(count,1000);




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s