gpt4 book ai didi

javascript - 如果焦点函数

转载 作者:行者123 更新时间:2023-11-30 06:45:24 25 4
gpt4 key购买 nike

我正在尝试在蜜蜂移动尚未完成时将其隐藏起来,如果它已聚焦

这是蜜蜂,它最初隐藏在云层之外,看不见,在前 4 秒内它从云层中上升,然后也在 4 秒内向右移动,然后在 0.3 秒内下降,就像它的隐藏一样,然后回到它在云层之外的原点,并且功能在 20 秒内重复。但我想,当这些 Action 集中时,我希望蜜蜂隐藏起来,我的意思是在 0.3 秒后下降,然后在 20 秒后它会再次出现。

    var bee5 = function() {
$("#bee5").animate({"top": "-50px"}, 3000, function() {
$(this).animate({"left": "130px"}, 700,function() {
$(this).animate({"left": "110px"}, 800, function() {
$(this).animate({"left": "125px"}, 700, function() {
$(this).animate({"left": "115px"}, 800, function() {
$(this).animate({"left": "130px"}, 1000, function() {
$(this).animate({"left": "110px"}, 900, function() {
$(this).animate({"left": "120px"}, 800, function() {
$(this).animate({"top": "-10px"}, 250)
})
})
})
})
})
})
})
})
$('#bee5').mouseover(function() {
$(this).animate({"top": "-10px"}, 250)
});
setTimeout(bee5, 15000);
}

这里是css:bee5原点

#bee5 { position:absolute; top:-10px; left:120px; z-index:0; }

最佳答案

如果你想在指针悬停在项目上时做动画,你应该使用mouseover而不是 focus,参见 this fiddle .

如果是表单输入,那么你可以使用blur .

关于javascript - 如果焦点函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7370880/

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