How do I achieve it?
I have a module named "tooltip" which has a "fade" function which in turn uses a global "element" variable. That variable is a reference to an element of the DOM. I want to update it from another module named "lightbox" so I could just let the "fade" function handle the fade-in effect. All my modules are declared using a closure.
var tooltip = function{
var element;
return{
fade: function(){ fade code goes here...}
};
}();
Can I just do the following to update "element" from the lightbox module?
tooltip.element = document.getElementByID('lightbox-con');
No jQuery code pls...