kianajoo
چهارشنبه 03 مهر 1392, 19:21 عصر
درود...
من از این تایمر استفاده میکنم....
$(function() {
jQuery.fn.countDown = function(settings,to) {
settings = jQuery.extend({
startFontSize: '36px',
endFontSize: '12px',
duration: 1000,
startNumber: 10,
endNumber: 0,
callBack: function() { }
}, settings);
return this.each(function() {
if(!to && to != settings.endNumber) { to = settings.startNumber; }
//set the countdown to the starting number
$(this).text(to).css('fontSize',settings.startFont Size);
//loopage
$(this).animate({
'fontSize': settings.endFontSize
},settings.duration,'',function() {
if(to > settings.endNumber ) {
$(this).css('fontSize',settings.startFontSize).tex t(to - 1).countDown(settings,to - 1);
}
else
{
settings.callBack(this);
}
});
});
};
$('#countdown').countDown({
startNumber: 10 ,
callBack: function(me) {
$(me).text('All done! This is where you give the reward!').css('color','#090');
alert("test");
}
});
});
<span id="countdown"></span>
میخوام یک دکمه یا لینک بهش اضافه کنم که تایمر رو واسم stop کنه...
:متفکر:
من از این تایمر استفاده میکنم....
$(function() {
jQuery.fn.countDown = function(settings,to) {
settings = jQuery.extend({
startFontSize: '36px',
endFontSize: '12px',
duration: 1000,
startNumber: 10,
endNumber: 0,
callBack: function() { }
}, settings);
return this.each(function() {
if(!to && to != settings.endNumber) { to = settings.startNumber; }
//set the countdown to the starting number
$(this).text(to).css('fontSize',settings.startFont Size);
//loopage
$(this).animate({
'fontSize': settings.endFontSize
},settings.duration,'',function() {
if(to > settings.endNumber ) {
$(this).css('fontSize',settings.startFontSize).tex t(to - 1).countDown(settings,to - 1);
}
else
{
settings.callBack(this);
}
});
});
};
$('#countdown').countDown({
startNumber: 10 ,
callBack: function(me) {
$(me).text('All done! This is where you give the reward!').css('color','#090');
alert("test");
}
});
});
<span id="countdown"></span>
میخوام یک دکمه یا لینک بهش اضافه کنم که تایمر رو واسم stop کنه...
:متفکر: