jquery 动态数字滚动
1、引入jQuery
<script src="js/jquery.min.js"></script>
2、html
<div id="count">14</div>
3、js函数
(function($){
$.fn.numberRock=function(options){
var defaults={
lastNumber:100, //最终值
duration:2000, //时间
easing:'swing' //swing(默认 : 缓冲 : 慢快慢) linear(匀速的)
};
var opts=$.extend({}, defaults, options); $(this).animate({
num : "numberRock",
// width : 300,
// height : 300,
},{
duration : opts.duration,
easing : opts.easing,
complete : function(){
console.log("success");
},
step : function(a,b){ //可以检测我们定时器的每一次变化
//console.log(a);
//console.log(b.pos); //运动过程中的比例值(0~1)
$(this).html(parseInt(b.pos * opts.lastNumber));
}
}); } })(jQuery);
4、js代码
$(function(){
$("#counta").numberRock({
lastNumber:14,
duration:3000,
easing:'swing', //慢快慢
});
});
jquery 动态数字滚动的更多相关文章
- jQuery动态数字翻滚计数到指定数字的文字特效代码
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 用jQuery实现数字滚动效果
html 部分 <div class="js-box box"></div> css 部分 .statistic .box{ display: inline ...
- jQuery 数字滚动插件
这几天闲来没事写的,有不对的地方还请多多指点 CSS: ; padding:0 2px;} .digital-beating i {;; background:url(../images/icon_0 ...
- 一款非常炫酷的jQuery动态随机背景滚动特效
一款非常炫酷的jQuery动态随机背景滚动特效 图片背景会不停息的滚动,带有那种漂浮的视觉效果,小圈圈飘动. 更好的是还兼容IE6浏览器,大伙可以好好研究研究. 适用浏览器:IE6.IE7.IE8.3 ...
- jQuery数字滚动(模拟网站人气、访问量递增)原创
插件描述:实现数字上下滚动,模拟网站人气.访问量递增的动画效果,兼容性如下: 使用方法 $(el).runNum(val,params); 参数详解 val:数值型(默认70225800): pa ...
- jquery 数字滚动方法
jquery 数字滚动方法用的是countUp.js这个插件 target = 目标元素的 ID:startVal = 开始值:endVal = 结束值:decimals = 小数位数,默认值是0:d ...
- jQuery+PHP+Ajax动态数字统计展示实例
jQuery+PHP+Ajax实现的一款动态数字统计展示实例,本例是在页面上动态展示了当前在线用户数,当然了,你可以应用到其他更多场景中. 首先我们在#number放置要统计的数字: <div ...
- jQuery.hhLRSlider 左右滚动图片插件
/** * jQuery.hhLRSlider 左右滚动图片插件 * User: huanhuan * QQ: 651471385 * Email: th.wanghuan@gmail.com ...
- 让数字变化炫酷起来,数字滚动Text组件[Unity]
让数字滚动起来 上周我的策划又提了样需求,当玩家评分发生变动时,屏幕出现人物评分浮层UI,播放评分数字滚动动画.这类数字滚动需求非常常见,我就按一般思路,将startvalue与endvalue每隔一 ...
随机推荐
- 再谈java clone 以及 浅/深拷贝
简单对象的拷贝,直接使用其clone方法 即可, 不会有什么问题: class Dog implements Cloneable public Dog clone() { int age; Strin ...
- centos 共享文件目录
# yum install nfs-utils # mkdir /storage # cat /etc/exports /storage *(fsid=0,rw,sync,no_root_squash ...
- Mac安装Mysql-python _mysql.c:44:10: fatal error: 'my_config.h' file not found
解决步骤 brew install mysql brew unlink mysql brew install mysql-connector-c sed -i -e /bin/mysql_config ...
- 4.ClassLink - 一种新型的VPC 经典网络的连接方式
阿里云CLassLink文档地址:https://help.aliyun.com/document_detail/65412.html?spm=a2c4g.11186623.2.9.41a25a07F ...
- js总结001
JSTL 表达式与 EL 语言 http://leon906998248.iteye.com/blog/1502569 2 jquery中$each()方法的使用指南 http: ...
- 【剑指offer】从尾到头翻转打印单链表
#include <iostream> #include <vector> #include <stack> using namespace std; struct ...
- 10. Lambda表达式.md
为了简化匿名内部类的代码,具体定义: 例如将9.内部类中的匿名内部类例子: 原来代码: //Main.java public class Main { public static void main( ...
- (转)如何禁用Windows 10系统的触摸屏
https://baijiahao.baidu.com/s?id=1593890738706748667 现在许多优质的Windows 10个人电脑都配备了触摸屏,因为触摸屏的日益普及,Windows ...
- 代码规范【经理培训内容记录】[有参考:http://kb.cnblogs.com/page/179593/]
一.命名规范 方法:所有首字母大写,如BloodControl; 类:所有首字母大写: 变量:第一个首字母小写,其他首字母大写:如bloodControl; 常量:全部字母大写,可用下划线分隔:如BL ...
- centos远程连接putty工具配置
Putty工具连接与使用步骤 作者:jason 登陆linux 一.关闭防火墙 输入命令 setup 完成后: 二.关闭selinux 输入命令 cd /etc/selinux 输入命令 vi co ...