Peršokti į turinį
  • ŽAIDIMAI
  • , ŽAIDIMAI
  • ŽAIDIMAI

Ši tema yra neaktyvi. Paskutinis pranešimas šioje temoje buvo prieš 3957 dienas (-ų). Patariame sukurti naują temą, o ne rašyti naują pranešimą.

Už neaktyvių temų prikėlimą galite sulaukti įspėjimo ir pranešimo pašalinimo!

Recommended Posts

(redaguota)

Va bandyk 

<script type="text/javascript">
function CountUp(initDate, id){
 this.beginDate = new Date(initDate);
 this.countainer = document.getElementById(id);
 this.numOfDays = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
 this.borrowed = 0, this.years = 0, this.months = 0, this.days = 0;
 this.hours = 0, this.minutes = 0, this.seconds = 0;
 this.updateNumOfDays();
 this.updateCounter();
}
 
CountUp.prototype.updateNumOfDays=function(){
 var dateNow = new Date();
 var currYear = dateNow.getFullYear();
 if ( (currYear % 4 == 0 && currYear % 100 != 0 ) || currYear % 400 == 0 ) {
 this.numOfDays[1] = 29;
 }
 var self = this;
 setTimeout(function(){self.updateNumOfDays();}, (new Date((currYear+1), 1, 2) - dateNow));
}
 
CountUp.prototype.datePartDiff=function(then, now, MAX){
 var diff = now - then - this.borrowed;
 this.borrowed = 0;
 if ( diff > -1 ) return diff;
 this.borrowed = 1;
 return (MAX + diff);
}
 
CountUp.prototype.calculate=function(){
 var currDate = new Date();
 var prevDate = this.beginDate;
 this.seconds = this.datePartDiff(prevDate.getSeconds(), currDate.getSeconds(), 60);
 this.minutes = this.datePartDiff(prevDate.getMinutes(), currDate.getMinutes(), 60);
 this.hours = this.datePartDiff(prevDate.getHours(), currDate.getHours(), 24);
 this.days = this.datePartDiff(prevDate.getDate(), currDate.getDate(), this.numOfDays[currDate.getMonth()]);
 this.months = this.datePartDiff(prevDate.getMonth(), currDate.getMonth(), 12);
 this.years = this.datePartDiff(prevDate.getFullYear(), currDate.getFullYear(),0);
}
 
CountUp.prototype.addLeadingZero=function(value){
 return value < 10 ? ("0" + value) : value;
}
 
CountUp.prototype.formatTime=function(){
 this.seconds = this.addLeadingZero(this.seconds);
 this.minutes = this.addLeadingZero(this.minutes);
 this.hours = this.addLeadingZero(this.hours);
}
 
CountUp.prototype.updateCounter=function(){
 this.calculate();
 this.formatTime();
 this.countainer.innerHTML ="<strong>" + this.years + "</strong> <small>" + (this.years == 1? "m." : "m.") + "</small>" +
 " <strong>" + this.months + "</strong> <small>" + (this.months == 1? "më." : "mėn.") + "</small>" +
 " <strong>" + this.days + "</strong> <small>" + (this.days == 1? "d." : "d.") + "</small>" +
 " <strong>" + this.hours + "</strong> <small>" + (this.hours == 1? "val." : "val.") + "</small>" +
 " <strong>" + this.minutes + "</strong> <small>" + (this.minutes == 1? "min." : "min.") + "</small>" +
 " <strong>" + this.seconds + "</strong> <small>" + (this.seconds == 1? "s." : "s.") + "</small>";
 var self = this;
 setTimeout(function(){self.updateCounter();}, 1000);
}
 
window.onload=function(){ new CountUp('May 30, 2014 16:00:00', 'counter'); }
 
</script>
<center>Projektas jau gyvuoja:
<div id="counter"><span style="font-family:trebuchet ms,helvetica,sans-serif;"><strong>0</strong> <small>m.</small> <strong>0</strong> <small>mën.</small> <strong>19</strong> <small>d.</small> <strong>02</strong> <small>val.</small> <strong>31</strong> <small>min.</small> <strong>32</strong> <small>s.</small></span></div>
</center>

ir šioje eilutėje

window.onload=function(){ new CountUp('May 30, 2014 16:00:00', 'counter'); }

pakeisk datą į savo  May 30, 2014 16:00:00

 

 

Šį kodą gali kur nors per Ad Code Integration arba per global template apačioje kur nors.

Redaguota , nario spt.
  • Teigiamai 2
  • Neigiamai 1

Va bandyk 

<script type="text/javascript">
function CountUp(initDate, id){
 this.beginDate = new Date(initDate);
 this.countainer = document.getElementById(id);
 this.numOfDays = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
 this.borrowed = 0, this.years = 0, this.months = 0, this.days = 0;
 this.hours = 0, this.minutes = 0, this.seconds = 0;
 this.updateNumOfDays();
 this.updateCounter();
}
 
CountUp.prototype.updateNumOfDays=function(){
 var dateNow = new Date();
 var currYear = dateNow.getFullYear();
 if ( (currYear % 4 == 0 && currYear % 100 != 0 ) || currYear % 400 == 0 ) {
 this.numOfDays[1] = 29;
 }
 var self = this;
 setTimeout(function(){self.updateNumOfDays();}, (new Date((currYear+1), 1, 2) - dateNow));
}
 
CountUp.prototype.datePartDiff=function(then, now, MAX){
 var diff = now - then - this.borrowed;
 this.borrowed = 0;
 if ( diff > -1 ) return diff;
 this.borrowed = 1;
 return (MAX + diff);
}
 
CountUp.prototype.calculate=function(){
 var currDate = new Date();
 var prevDate = this.beginDate;
 this.seconds = this.datePartDiff(prevDate.getSeconds(), currDate.getSeconds(), 60);
 this.minutes = this.datePartDiff(prevDate.getMinutes(), currDate.getMinutes(), 60);
 this.hours = this.datePartDiff(prevDate.getHours(), currDate.getHours(), 24);
 this.days = this.datePartDiff(prevDate.getDate(), currDate.getDate(), this.numOfDays[currDate.getMonth()]);
 this.months = this.datePartDiff(prevDate.getMonth(), currDate.getMonth(), 12);
 this.years = this.datePartDiff(prevDate.getFullYear(), currDate.getFullYear(),0);
}
 
CountUp.prototype.addLeadingZero=function(value){
 return value < 10 ? ("0" + value) : value;
}
 
CountUp.prototype.formatTime=function(){
 this.seconds = this.addLeadingZero(this.seconds);
 this.minutes = this.addLeadingZero(this.minutes);
 this.hours = this.addLeadingZero(this.hours);
}
 
CountUp.prototype.updateCounter=function(){
 this.calculate();
 this.formatTime();
 this.countainer.innerHTML ="<strong>" + this.years + "</strong> <small>" + (this.years == 1? "m." : "m.") + "</small>" +
 " <strong>" + this.months + "</strong> <small>" + (this.months == 1? "më." : "mėn.") + "</small>" +
 " <strong>" + this.days + "</strong> <small>" + (this.days == 1? "d." : "d.") + "</small>" +
 " <strong>" + this.hours + "</strong> <small>" + (this.hours == 1? "val." : "val.") + "</small>" +
 " <strong>" + this.minutes + "</strong> <small>" + (this.minutes == 1? "min." : "min.") + "</small>" +
 " <strong>" + this.seconds + "</strong> <small>" + (this.seconds == 1? "s." : "s.") + "</small>";
 var self = this;
 setTimeout(function(){self.updateCounter();}, 1000);
}
 
window.onload=function(){ new CountUp('May 30, 2014 16:00:00', 'counter'); }
 
</script>
<center>Projektas jau gyvuoja:
<div id="counter"><span style="font-family:trebuchet ms,helvetica,sans-serif;"><strong>0</strong> <small>m.</small> <strong>0</strong> <small>mën.</small> <strong>19</strong> <small>d.</small> <strong>02</strong> <small>val.</small> <strong>31</strong> <small>min.</small> <strong>32</strong> <small>s.</small></span></div>
</center>

ir šioje eilutėje

window.onload=function(){ new CountUp('May 30, 2014 16:00:00', 'counter'); }

pakeisk datą į savo  May 30, 2014 16:00:00

 

 

Šį kodą gali kur nors per Ad Code Integration arba per global template apačioje kur nors.

ir kur ta visą koda dėti?

 

Visi kopina nuo http://las-venturas.lt/timer.php


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  		<link href="/new/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
		<style>
		body {
			background: #f4f4f4;
		}
		</style>
<head>
<title>Timer</title>
<script type="text/javascript">
function CountUp(initDate, id){
    this.beginDate = new Date(initDate);
    this.countainer = document.getElementById(id);
    this.numOfDays = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
    this.borrowed = 0, this.years = 0, this.months = 0, this.days = 0;
    this.hours = 0, this.minutes = 0, this.seconds = 0;
    this.updateNumOfDays();
    this.updateCounter();
}
  
CountUp.prototype.updateNumOfDays=function(){
    var dateNow = new Date();
    var currYear = dateNow.getFullYear();
    if ( (currYear % 4 == 0 && currYear % 100 != 0 ) || currYear % 400 == 0 ) {
        this.numOfDays[1] = 29;
    }
    var self = this;
    setTimeout(function(){self.updateNumOfDays();}, (new Date((currYear+1), 1, 2) - dateNow));
}
  
CountUp.prototype.datePartDiff=function(then, now, MAX){
    var diff = now - then - this.borrowed;
    this.borrowed = 0;
    if ( diff > -1 ) return diff;
    this.borrowed = 1;
    return (MAX + diff);
}
  
CountUp.prototype.calculate=function(){
    var currDate = new Date();
    var prevDate = this.beginDate;
    this.seconds = this.datePartDiff(prevDate.getSeconds(), currDate.getSeconds(), 60);
    this.minutes = this.datePartDiff(prevDate.getMinutes(), currDate.getMinutes(), 60);
    this.hours = this.datePartDiff(prevDate.getHours(), currDate.getHours(), 24);
    this.days = this.datePartDiff(prevDate.getDate(), currDate.getDate(), this.numOfDays[currDate.getMonth()]);
    this.months = this.datePartDiff(prevDate.getMonth(), currDate.getMonth(), 12);
    this.years = this.datePartDiff(prevDate.getFullYear(), currDate.getFullYear(),0);
}
  
CountUp.prototype.addLeadingZero=function(value){
    return value < 10 ? ("0" + value) : value;
}
  
CountUp.prototype.formatTime=function(){
    this.seconds = this.addLeadingZero(this.seconds);
    this.minutes = this.addLeadingZero(this.minutes);
    this.hours = this.addLeadingZero(this.hours);
}
 
CountUp.prototype.updateCounter=function(){
    this.calculate();
    this.formatTime();
    this.countainer.innerHTML ="<strong>" + this.years + "</strong> <small>" + (this.years == 1? "m." : "m.") + "</small>" +
        " <strong>" + this.months + "</strong> <small>" + (this.months == 1? "mėn." : "mėn.") + "</small>" +
        " <strong>" + this.days + "</strong> <small>" + (this.days == 1? "d." : "d.") + "</small>" +
        " <strong>" + this.hours + "</strong> <small>" + (this.hours == 1? "val." : "val.") + "</small>" +
        " <strong>" + this.minutes + "</strong> <small>" + (this.minutes == 1? "min." : "min.") + "</small>" +
        " <strong>" + this.seconds + "</strong> <small>" + (this.seconds == 1? "s." : "s.") + "</small>";
    var self = this;
    setTimeout(function(){self.updateCounter();}, 1000);
}
 
window.onload=function(){ new CountUp('Jan 30, 2012 15:00:00', 'counter'); }
 
</script>
</head>
<body>
<span style="font-family: Tahoma; font-size: 11px;">
Projektas jau gyvuoja:
<div id="counter">...</div>
</span>
</body>
</html>

Pasidaryk kaip php failą ir įterpk kaip iframe

  • Teigiamai 1

Ši tema yra neaktyvi. Paskutinis pranešimas šioje temoje buvo prieš 3957 dienas (-ų). Patariame sukurti naują temą, o ne rašyti naują pranešimą.

Už neaktyvių temų prikėlimą galite sulaukti įspėjimo ir pranešimo pašalinimo!

Svečias
Ši tema yra užrakinta.
  • Šiame puslapyje naršo:   0 nariai

    • Nėra registruotų narių peržiūrinčių šį forumą.

Skelbimai



×
×
  • Sukurti naują...