Multiple jQuery scroll event performance

Viewed 63

I would like to know which is the best method to create different events during the scroll. Are there any differences (maybe even in performance) between these two codes?

$(window).scroll(function() {
// Do things A
}
$(window).scroll(function() {
// Do things B
}
$(window).scroll(function() {
thingsA();
thingsB();
}
function thingsA() {
// Do things A
}
function thingsB() {
// Do things B
}

Is there any specific advice to follow to improve the performance and loading of the page in these cases?

0 Answers
Related