function swapPic(){ var self = this; // Preload the Image var image = new Image(); image.onload = function(){ self.fade(); } image.src = this.pic; this.obj.src = this.pic; this.callback = self.remove; this.to = 100; this.from = 0; this.curr = this.from; }
