gpt4 book ai didi

jquery - 如何停止我的 jquery 动画?

转载 作者:行者123 更新时间:2023-11-28 12:08:04 24 4
gpt4 key购买 nike

(function ($) {
$(document).ready(function () {

$('#road').pan({ fps: 30, speed: 9 });

$('#city2').pan({ fps: 30, speed: 2 });

$('#city3').pan({ fps: 30, speed: 5 });

$('#sky').pan({ fps: 30, speed: 0.5 });

$('#plane1').sprite({ fps: 10, no_of_frames: 8 });

$('#stop').click(function () {
$('#body').stop();
$('#city2').stop();
$('#city3').stop();
$('#sky').stop();
$('#road').stop();
});

});
});

这是我的代码,你能告诉我如何阻止我的城市和道路移动吗?我尝试使用停止,但它不起作用。

最佳答案

你试过吗:

.stop(true)

代码:

    $('#stop').click(function () {
$('#body').stop(true);
$('#city2').stop(true);
$('#city3').stop(true);
$('#sky').stop(true);
$('#road').stop(true);
});

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

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