1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2. <html xmlns="http://www.w3.org/1999/xhtml">
    3. <head>
    4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
    6. <meta name="viewport" content="width=device-width, initial-scale=1">
    7. <title>html5圆形进度条加载按钮 - 站长素材</title>
    8. <link rel="stylesheet" type="text/css" href="css/normalize.css" />
    9. <link rel="stylesheet" type="text/css" href="css/demo.css" />
    10. <!--必要样式-->
    11. <link rel="stylesheet" type="text/css" href="css/component.css" />
    12. <script src="js/modernizr.custom.js"></script>
    13. </head>
    14. <body>
    15. <section>
    16. <h2>默认效果 (成功, 错误)</h2>
    17. <div class="box">
    18. <!-- progress button -->
    19. <div class="progress-button">
    20. <button><span>Submit</span></button>
    21. <svg class="progress-circle" width="70" height="70"><path d="m35,2.5c17.955803,0 32.5,14.544199 32.5,32.5c0,17.955803 -14.544197,32.5 -32.5,32.5c-17.955803,0 -32.5,-14.544197 -32.5,-32.5c0,-17.955801 14.544197,-32.5 32.5,-32.5z"/></svg>
    22. <svg class="checkmark" width="70" height="70"><path d="m31.5,46.5l15.3,-23.2"/><path d="m31.5,46.5l-8.5,-7.1"/></svg>
    23. <svg class="cross" width="70" height="70"><path d="m35,35l-9.3,-9.3"/><path d="m35,35l9.3,9.3"/><path d="m35,35l-9.3,9.3"/><path d="m35,35l9.3,-9.3"/></svg>
    24. </div><!-- /progress-button -->
    25. <!-- progress button -->
    26. <div class="progress-button">
    27. <button><span>Submit</span></button>
    28. <svg class="progress-circle" width="70" height="70"><path d="m35,2.5c17.955803,0 32.5,14.544199 32.5,32.5c0,17.955803 -14.544197,32.5 -32.5,32.5c-17.955803,0 -32.5,-14.544197 -32.5,-32.5c0,-17.955801 14.544197,-32.5 32.5,-32.5z"/></svg>
    29. <svg class="checkmark" width="70" height="70"><path d="m31.5,46.5l15.3,-23.2"/><path d="m31.5,46.5l-8.5,-7.1"/></svg>
    30. <svg class="cross" width="70" height="70"><path d="m35,35l-9.3,-9.3"/><path d="m35,35l9.3,9.3"/><path d="m35,35l-9.3,9.3"/><path d="m35,35l9.3,-9.3"/></svg>
    31. </div><!-- /progress-button -->
    32. </div>
    33. <h2>弹性效果(成功, 错误)</h2>
    34. <div class="box">
    35. <!-- progress button -->
    36. <div class="progress-button elastic">
    37. <button><span>Submit</span></button>
    38. <svg class="progress-circle" width="70" height="70"><path d="m35,2.5c17.955803,0 32.5,14.544199 32.5,32.5c0,17.955803 -14.544197,32.5 -32.5,32.5c-17.955803,0 -32.5,-14.544197 -32.5,-32.5c0,-17.955801 14.544197,-32.5 32.5,-32.5z"/></svg>
    39. <svg class="checkmark" width="70" height="70"><path d="m31.5,46.5l15.3,-23.2"/><path d="m31.5,46.5l-8.5,-7.1"/></svg>
    40. <svg class="cross" width="70" height="70"><path d="m35,35l-9.3,-9.3"/><path d="m35,35l9.3,9.3"/><path d="m35,35l-9.3,9.3"/><path d="m35,35l9.3,-9.3"/></svg>
    41. </div><!-- /progress-button -->
    42. <!-- progress button -->
    43. <div class="progress-button elastic">
    44. <button><span>Submit</span></button>
    45. <svg class="progress-circle" width="70" height="70"><path d="m35,2.5c17.955803,0 32.5,14.544199 32.5,32.5c0,17.955803 -14.544197,32.5 -32.5,32.5c-17.955803,0 -32.5,-14.544197 -32.5,-32.5c0,-17.955801 14.544197,-32.5 32.5,-32.5z"/></svg>
    46. <svg class="checkmark" width="70" height="70"><path d="m31.5,46.5l15.3,-23.2"/><path d="m31.5,46.5l-8.5,-7.1"/></svg>
    47. <svg class="cross" width="70" height="70"><path d="m35,35l-9.3,-9.3"/><path d="m35,35l9.3,9.3"/><path d="m35,35l-9.3,9.3"/><path d="m35,35l9.3,-9.3"/></svg>
    48. </div><!-- /progress-button -->
    49. </div>
    50. </section>
    51. <script type="text/javascript" src="js/classie.js"></script>
    52. <script type="text/javascript" src="js/uiProgressButton.js"></script>
    53. <script type="text/javascript">
    54. [].slice.call( document.querySelectorAll( '.progress-button' ) ).forEach( function( bttn, pos ) {
    55. new UIProgressButton( bttn, {
    56. callback : function( instance ) {
    57. var progress = 0,
    58. interval = setInterval( function() {
    59. progress = Math.min( progress + Math.random() * 0.1, 1 );
    60. instance.setProgress( progress );
    61. if( progress === 1 ) {
    62. instance.stop( pos === 1 || pos === 3 ? -1 : 1 );
    63. clearInterval( interval );
    64. }
    65. }, 150 );
    66. }
    67. } );
    68. } );
    69. </script>
    70. <div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
    71. <p>适用浏览器:360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗. 不支持IE8及以下浏览器。</p>
    72. <p>来源:<a href="http://sc.chinaz.com/" target="_blank">站长素材</a></p>
    73. </div>
    74. </body>
    75. </html>