使用 jquery 更改背景图像
我有这个 jquery 代码,可以在单击时更改背景图像:
$('a.note').click(function(){
$('#full').css('background-image','img/1.jpg');
});
但是,它没有改变。我有什么遗漏的吗?
I have this jquery code that changes the image of the background on click:
$('a.note').click(function(){
$('#full').css('background-image','img/1.jpg');
});
However, it's not changing. Is there something I'm missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要包含
background-image
属性的url()
部分。You need to include the
url()
part of thebackground-image
property.