I have a similar question to this Stack post; but, would like to call the function in a jquery chain. Here is my pseudo code:
function togglePanels(f) {
var customchain;
if (f == 'n') {
customchain = $.next();
} else {
customchain = $.prev();
}
let $next_or_prev_panel = $current_panel
.parents("div")
.eq("2")
.customchain("div")
.find(".panel");
}
I imagine the solution will involve prototyping the jQuery library somehow?