Reputation: 719
Little confusing. From within function evenCard I'd like to call function autoFlip and pass it function evenBack as an argument. Then to complicate things further, autoFlip needs to pass the argument to another function nested within it and then call function evenBack. Is this possible? Thanks!
function evenCard() {
autoFlip_toggle = true;
autoFlip(evenBack);
}
function autoFlip(back) {
// do other stuff
$(window).scroll(function() {
if (autoFlip_toggle == true) {
// Call evenBack somehow?
}
});
}
function evenBack() {
// Does stuff
}
Upvotes: 0
Views: 108
Reputation: 289
Call back(); within autoFlip.
function autoFlip(back) {
// do other stuff
$(window).scroll(function() {
if (autoFlip_toggle == true) {
back();
}
});
}
Upvotes: 2