先上插件链接地址:http://fgnass.github.io/spin.js/

以下是使用spin.js插件的完整版测试例子:

<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>test_storage</title>
<script type="text/javascript" src="spin.min.js"></script>
<script type="text/javascript">
window.onload = function(){
var opts = {
lines: 13, // The number of lines to draw |小长条的数量
length: 13, // The length of each line |小长条的长度
width: 3, // The line thickness |小长条的宽度
radius: 15, // The radius of the inner circle |内环的半径长
corners: 1, // Corner roundness (0..1)
rotate: 0, // The rotation offset |旋转角度
direction: 1, // 1: clockwise, -1: counterclockwise |1:顺时针方向 -1:逆时针方向
color: '#000', // #rgb or #rrggbb or array of colors |颜色
speed: 1, // Rounds per second |每秒转多少圈
trail: 60, // Afterglow percentage |余晖效果百分比
shadow: false, // Whether to render a shadow |渲染阴影
hwaccel: false, // Whether to use hardware acceleration |加速
className: 'spinner', // The CSS class to assign to the spinner |类名spinner
zIndex: 2e9, // The z-index (defaults to 2000000000) |显示在最顶层
top: 'auto', // Top position relative to parent in px |相对父元素的top
left: 'auto' // Left position relative to parent in px |相对父元素的left ,默认情况spinner是显示于父元素居中位置
};
var target = document.getElementById('foo');
var spinner = new Spinner(opts).spin(target);//给id为foo的div 中绑上spinner //或者使用spinner.el属性插入DOM /* 如下 */
/*var spinner = new Spinner().spin();
target.appendChild(spinner.el);*/ //spinner.stop();//用来移除spinner,停止动画
} </script> </head> <body> <div id="foo" style="height:100px;"></div> </body> </html>

结果图如下所示:

最新文章

  1. mySql 远程连接(is not allowed to connect to this MySQL server)
  2. android sdk manager 代理设置(送给牛逼的)
  3. 10G整数文件中寻找中位数或者第K大数
  4. 基于Spark1.3.0的Spark sql三个核心部分
  5. iOS中UIWebView与其中网页的javascript的交互
  6. 【poj2778-DNA Sequence】AC自动机+矩阵乘法
  7. Simple Factory 简单工厂模式(静态工厂)
  8. 选择排序的MPI实现
  9. Form表单中的三种查询方法
  10. vsftp配置主动模式和被动模式
  11. Thml 小插件8 天气插件定制
  12. Apriori算法原理总结
  13. JS 中的this指向问题和call、apply、bind的区别
  14. Windows远程桌面连接 出现身份错误 要求的函数不受支持
  15. 【缓存】介绍和使用场景 MEMCACHE REDIS
  16. vue2之对象属性的监听
  17. easyUI拖动:draggable()方法运用
  18. flex学习, 尝试布局一个计算器
  19. 企业安全建设之搭建开源SIEM平台
  20. Python3 tkinter基础 Button command 单击按钮 在console中打印文本

热门文章

  1. Javascript and AJAX with Yii(在yii 中使用 javascript 和ajax)
  2. 5步做好vsftpd
  3. springboot +spring security4 自定义手机号码+短信验证码登录
  4. wxPython中添加窗口标题图标
  5. c pointer and array
  6. JavaScript 应用开发 #1:理解模型与集合
  7. Ubuntu 13.10 Rhythmbox 播放器不能播放MP3。安装插件
  8. Linux查看当前系统登录用户、登录日志、登录错误日志
  9. Spring Mvc session拦截器实现
  10. css3 盒模型