如何停止旋转.js



我正在使用spin.js作为页面上的微调器。有没有办法让我在 4 圈后停止旋转并用文本替换旋转。

任何帮助将不胜感激!

我的代码如下:

<div class="spin">
<div id="spin">
</div> </div>

<script type="text/javascript" src="js/spin2.js"></script>
<script type="text/javascript">
 var opts = {
              lines: 16, // The number of lines to draw 
              length: 0, // The length of each line
              width: 7, // The line thickness
              radius: 37, // The radius of the inner circle
              corners: 1,
              rotate: 0, // The rotation offset
              direction: 1,
              color: '#000', // #rgb or #rrggbb
              speed: 1.6, // Rounds per second
              trail: 100, // 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
              zIndex: 2e9, // The z-index (defaults to 2000000000)
              top: 'auto', // Top position relative to parent in px
              left: 'auto' // Left position relative to parent in px
            };
               var target = document.getElementById('spin');
               var spinner = new Spinner(opts).spin(target);
$(target).data('spinner').stop();

var spinner = new Spinner();
spinner.stop(target);

$(target).spin(false);

最新更新