!_this.menuClicked
To clarify, the variable menuClicked is a boolean indicator of whether a menu has been clicked. Therefore, when it is stated as !_this.menuClicked == true
, it means that if a menu has not been clicked, then execute the following:
(($(".last-menuitem").attr("id") == $("#menu li.active").find("a:last-child").not(".ignore-ele").attr("class")
||
$(".last-menuitem").find(".view-holder").attr("id") == $("#menu li.active").find("a:last-child").not(".ignore-ele").attr("class")
||
($(window).scrollTop() + $(window).height() >= $(document).height() - 20))
(".last-menuitem").attr("id") == $("#menu li.active").find("a:last-child").not(".ignore-ele").attr("class")
The initial check ensures that the id of lastMenuItem matches the class of the last child in the active menu, excluding those with the ignore class.
If this condition holds true, we proceed to the nested ternary operation:
($(".last-menuitem").length!=0 && $(".arrow").addClass('yellow'))
This part verifies if the class last-menuitem contains elements, then adds a yellow styling to elements with the arrow class.
If the first condition of the nested ternary is false, we move to the second part:
$(".last-menuitem").find(".view-holder").attr("id") == $("#menu li.active").find("a:last-child").not(".ignore-ele").attr("class")
Here, it checks if the id of lastMenuItem with the view-holder class matches the class of the last child in the active menu, excluding those with ignore class.
If neither of the previous conditions is met, the third part of the nested ternary is executed:
($(window).scrollTop() + $(window).height() >= $(document).height() - 20))
When the sum of the scroll position and window height surpasses the document height minus 20, it returns true and performs the corresponding action. If none of the conditions are true, the false part is executed:
($(".arrow").removeClass('yellow'))):
In case all conditions are false, the yellow styling is removed from elements with the arrow class. The ternary operation has been broken down below for better understanding:
!_this.menuclicked ?
(
(
$(".last-menuitem").attr("id") == $("#menu li.active").find("a:last-
child").not(".ignore-ele").attr("class")
|| $(".last-menuitem").find(".view-holder").attr("id") == $("#menu
li.active").find("a:last-child").not(".ignore-ele").attr("class")
|| ($(window).scrollTop() + $(window).height() >= $(document).height()
- 20)
)
? ($(".last-menuitem").length!=0 && $(".arrow").addClass('yellow'))
: ($(".arrow").removeClass('yellow'))
):