gpt4 book ai didi

jquery - 按下提交按钮的动画背景?

转载 作者:行者123 更新时间:2023-11-28 15:55:43 25 4
gpt4 key购买 nike

我正在尝试为提交按钮制作动画。

我有以下 html:

<input id="save" val="save" />

和CSS:

#save { background: #ccc; }

.saving { background: #ccc url(/img/savingstripes.png) repeat; }

和jquery:

$('#save').click(function(e) { 

e.preventDefault();

$(this).addClass('saving').animate({backgroundPosition: '100px 0px'});

})

当我按下这个按钮时,我得到的只是添加到按钮上的“保存”类,但没有动画。

我错过了什么? (注意:我有 backgroundPosition plugin )

最佳答案

我知道发生了什么...这是您的 background: #ccc; 声明。出于某种原因,它需要是 background-color: #ccc; 并且不会以任何其他方式工作。 See here .

关于jquery - 按下提交按钮的动画背景?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7115491/

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