0
我想在Jquery計數器中添加一些文本。我希望文本出現在數字下方。如果我將它添加進去,它會消失。這是代碼。JQuery計數器內的文本
<script type='text/javascript' src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
var currentNumber = $('#dynamic-number').text();
$({numberValue: currentNumber}).animate({numberValue: 8}, {
duration: 800,
easing: 'linear',
step: function() {
$('#dynamic-number').text(Math.ceil(this.numberValue));
}
});
</script>
<p id="dynamic-number">0</p>
<style>
#dynamic-number {
width: 100px;
height: 100px;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
border:solid 1px #f00;
font: bold 55px Arial;
color: black;
text-align: center;
margin: 30px 30px 0 0;
}
</style>
謝謝我會嘗試。但是如果我想並排添加三個這樣的計數器呢? – therookie
@therookie我在EDIT下添加了一個小提琴,包括多個計數器 – Xanfar