Giter Club home page Giter Club logo

jquery.numscroll.js's Introduction

NumScroll

数字滚动累加动画插件(Digital scroll cumulative animation plug-in)

1.使用前先引入jquery (Introduce jQuery before use)
2.加入学习Q群:814798690 (Join Learning QQ Group: 814798690)

案例展示(Case presentation)

查看演示

下载地址(Download address)

https://github.com/chaorenzeng/jquery.numscroll.js.git

快速使用(Quick use)

1.引入jquery和jquery.numscroll.js

<script src="js/jquery-1.10.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.numscroll.js" type="text/javascript" charset="utf-8"></script>

2.拷贝以下布局结构 (Copy the following layout structure)

<p><span id="num0"></span></p>
<p><span id="num1"></span></p>
<p><span id="num2"></span></p>

3.创建numscroll对象 (Create numscroll objects)

$(function() {
	//num0
	var num0 = 893689,addNum0,newNum0;
	$('#num0').text(num0);
	setInterval(function() {
		addNum0 = Math.random()*1000;
		newNum0 = parseInt(num0) + parseInt(addNum0);
		num0 = newNum0;
		$('#num0').numScroll({
			number: newNum0
		})
	}, 1500)
	
	//num1
	var num1 = 893623.89,addNum1,newNum1;
	$('#num1').text(num1);
	setInterval(function() {
		addNum1 = Math.random()*1000;
		newNum1 = (parseFloat(num1) + parseFloat(addNum1)).toFixed(2);
		num1 = newNum1;
		$('#num1').numScroll({
			number: newNum1
		})
	}, 1500)
	
	//num2
	var num2 = '893692813.89',addNum2,newNum2;
	$('#num2').text(num2);
	setInterval(function() {
		addNum2 = Math.random()*10000;
		newNum2 = (parseFloat(num2) + parseFloat(addNum2)).toFixed(2);
		num2 = newNum2;
		$('#num2').numScroll({
			number: newNum2,
			symbol: true
		})
	}, 1800)
})

支持参数(Support parameters)

可选参数 Parameter 默认值 Default 说明 Introduce
number 0 显示值
step 1 步长
time 2000 限制用时(为null时不限制) Limited use time
delay 0 延迟开始 delay
symbol false 是否显示分隔符 display separators
fromZero true 是否从0开始计数(为否时从原有值开始计数) start counting from zero

jquery.numscroll.js's People

Contributors

chaorenzeng avatar

Stargazers

 avatar 阿宏十八式 avatar  avatar  avatar  avatar yyf avatar  avatar  avatar 童心丶 avatar didi avatar Seeker avatar 国安庆 avatar

Watchers

Adilson Borszcz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.