我希望 screenCheck 函数显示仅在#contact_email
. 但就我而言,它在此之前运行。我该如何纠正?
<script>
function screenCheck() {
var screenWidth = window.screen.width;
if (screenWidth == '1024') {
$('#textAreaMsg label.error').css('margin-left', '99px');
}
}
$(document).ready(function() {
$("#contact_email").validate(screenCkeck());
</script>