I have the following javascript code:
EventsManager.prototype.hideContainer = function() { var that = this; var index = that.getNextUnreadEventIndex(); if(index !== -1) { EventsManager.animateHideLeft(function() //<--- passing a function as parameter to another function { var unreadEvent = that.eventsList.splice(index,1)[0]; unreadEvent.isEventOnFocus = true; that.eventsList.push(unreadEvent); that.displayLastEvent(); }); } }
Here is the code for the EventsManager.animateHideLeft () function:
EventsManager.animateHideLeft = function(callback) { var p = document.getElementById("eventsContainer"); var width = parseFloat(p.style.width); if(!width || width === "NaN") width = 200; if(width <= 10) { clearTimeout(fr); alert(typeof callback);
Unfortunately, the animateHideLeft function is not working properly. When I check the callback type, it warns "undefined".
How can I fix this mess to get the expected result?
source share