Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法将一个小的动画 GIF 变成按钮的背景图像?我试过这个:
$("#button").css('background-image', '~~.gif');
但它没有用。
$('#button').css('backgroundImage', 'url("anim.gif")');
例子
对于<input type="button" />并且<button>它也可以正常工作:
<input type="button" />
<button>
例 2
正如 j08691 所说:
$("#button").css({"backgroundImage" : "url(anim.gif)"});