jQuery
<script>
$(document).ready(function(){
$("button").click(function(){
$("h2").animate({backgroundColor: '#00f', width: '50%', marginLeft: '50px'});
});
});
</script>
html
<h2>This is a heading</h2>
<p style="background: #ff0">This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Click me</button>
我正在学习 jquery 并发现在我的测试中使用 css as margin-left
to marginLeft
like thismarginLeft
工作但backgroundColor
无法工作。我在这里还是我错了?