私のコードにいくつかのエラーがあります。誰かが私を助けてくれるかもしれない。私はこのエラーを取得しています:jquery関数でCSSプロパティを適用する
SyntaxError: missing formal parameter: $(this).css("position" , "relative");
$(document).keydown(function(e) {
var count = 0;
if (e.keyCode == 40) {
count++;
}
if (count == 1) {
$('#box').animate({
borderSpacing: -90
}, {
step: function(now, fx) {
$(this).css('-webkit-transform', 'rotate(' + now + ' deg)');
$(this).css('-moz-transform', 'rotate(' + now + ' deg)');
$(this).css('transform', 'rotate(' + now + ' deg)');
},
duration: 'slow'
}, 'linear');
} else {
$('#box').animate({
height: '10%'
}, {
$(this).css("position", "relative");
$(this).css("margin-top", "100px");
$(this).css("width", "30%");
$(this).css("background-color", "tomato");
$(this).css("margin-left", "20%");
$(this).css("align-content", "center");
});
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="box">
<div id="box2"></div>
</div>
[にSyntaxError:欠落している仮パラメータ](http://stackoverflow.com/questions/25290794/syntaxerror-missing-formal-parameter) – Mohammad
あなたは匿名関数ラッパーを欠場、チェックdoc –
'jQuery.fn.animate'の2番目の引数は関数でなければなりません – synthet1c