我想在拖动过程中更改可拖动元素的属性(字体颜色,背景颜色,z-index)。我不知道问题是否是IE9,但是有代码工作的属性,还有其他的代码不工作。关于更改可拖动元素的属性
$(function() {
$('.comurl').draggable({
start: function(event, ui) {
$(this).css("background-color","red"); //works
$(this).css("color","red"); //doesn't
$(this).css("z-index","999999"); //doesn't
},
stop: function(event, ui) {
$(this).css("background-color","green"); //works
$(this).css("color","green"); //doesn't
$(this).css("z-index","auto"); //doesn't
}
});
});
以这种方式调用属性的名称是否不同?这是IE9的问题吗?
有趣的...你能[JSFiddle](http://jsfiddle.net/)演示? –
'$(this).css({“background-color”:“red”,“color”:“red”,“z-index”:“999999”});'? –