【发布时间】:2014-05-15 20:36:04
【问题描述】:
我正在尝试使用以下代码从下拉选择中更改 html5 画布的背景图像
$('select').on('change', function() {
if (this.value ==1){
$('#canvas').css('background-image').fadeOut();
$('#canvas').css({'background': 'url(http://localhost/MapBox/img/cal_NAs.png) no-repeat top right, url(http://localhost/MapBox/img/bg_sh.png) no-repeat top right','background-color' : 'grey'}).fadeIn();
}
})
但这不起作用,我在控制台上收到此错误:Uncaught TypeError: undefined is not a function。 你能告诉我我做错了什么吗?
【问题讨论】: