$(window).on('scroll', function() {
if ($('.some-class-matching-one-element-in-a-tree-of-one-hundred-thousand').offset().top > $(window).scrollTop()) {
$('.some-class-matching-one-element-in-a-tree-of-one-hundred-thousand').on('click', function() {
if ($(this).closest('.some-other-random-class').hasClass('selected')) {
$(this).closest('.some-other-random-class').addClass('.blue-background');
$('.some-class-matching-one-element-in-a-tree-of-one-hundred-thousand').removeClass('selected');
}
}
}
});
Then when you have terrible mobile performance you just tell the stakeholders that if they want good performance they need to pay you more to then make a native app.jQuery(which was really sizzle) was a plague because it allowed garbage developers to search the entire DOM over and over and over again(aka get shit done bro). This would clobber the performance in mobile devices because JavaScript is single threaded and lead to the idea that JavaScript itself was unsuited for mobile applications.
Sorry, its garbage for anything but spicing up a WordPress site.