gpt4 book ai didi

jquery - 如何停止 spin.js

转载 作者:行者123 更新时间:2023-12-01 04:51:54 25 4
gpt4 key购买 nike

我正在使用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);

关于jquery - 如何停止 spin.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18858507/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com