Introduction
The jQuery library is a powerful tool for creating dynamic webpages and applications. However, when coding with jQuery, it is possible to encounter errors. One such error is the “ERROR . after argument list” error. This error occurs when the syntax of a jQuery statement is incorrect. In this article, we will discuss the causes of this error and how to solve it. We will also provide some tips to help you avoid this error in the future.
Solution
The issue is likely caused by a missing closing parenthesis. Make sure that all parentheses are properly closed and that there are no extra parentheses.
You had syntax errors all over the place.
Some misplaced brackets and so on as you could see in your error floating-j-menu.js:line 26:column 26:missing ) after argument list
.
Here is your code:
if ($("body").height() > $(window).height() - 41) {
$('#menuJF').removeClass('hide');
}
menuPosition = $('#menuJF').position().top + 485;
//FloatMenu();
$(window).scroll(function() {
//FloatMenu();
if ($(window).scrollTop() + $(window).height() > $(document).height() - 41) {
$('#menuJF').addClass('hide');
} else {
$('#menuJF').removeClass('hide');
}
});
#menuJF {
border: 1px solid;
height: 1500px;
background: red;
}
.hide {
opacity: 0;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="menuJF">
this is my menu
</div>
I also commented out floatMenu()
function since you haven’t provided its functionality.
5
solved jQuery – [ERROR] . after argument list [closed]