MediaWiki: Common.js: Unterschied zwischen den Versionen
Aus Joachim Camerarius (1500-1574)
Noeth (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Noeth (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 6: | Zeile 6: | ||
/***************************************************************/ | /***************************************************************/ | ||
/********* Animate stat-counter on main page | /************** Animate stat-counter on main page *************/ | ||
/**************************************************************/ | /**************************************************************/ | ||
$('.counting').each(function() { | $('.counting').each(function() { | ||
var $this = $(this), | var $this = $(this), | ||
countTo = $this.attr('data-count') | countTo = $( "span."+$this.attr('data-count') ).text() | ||
$({ countNum: $this.text()}).animate({ | $({ countNum: $this.text()}).animate({ |
Version vom 16. November 2018, 23:03 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */ /**********************************/ $("#testDiv").load("http://microsoft.com"); /***************************************************************/ /************** Animate stat-counter on main page *************/ /**************************************************************/ $('.counting').each(function() { var $this = $(this), countTo = $( "span."+$this.attr('data-count') ).text() $({ countNum: $this.text()}).animate({ countNum: countTo }, { duration: 2000, easing:'linear', step: function() { $this.text(Math.floor(this.countNum)); }, complete: function() { $this.text(this.countNum); //alert('finished'); } }); });