how to pass callback with variables?
how to pass callback with variables?
-
- function scrollToElement(element, offSet, callback) {
- $('html, body').animate({
- scrollTop: $(element).offset().top + offSet
- }, 800, function () { if (callback) callback(); });
- }
- //and from some function i call:
- scrollToElement($p, -80, function () {
- openTv($p)
- });