html - Fade background color not working with javascript -


I am trying to paint a background that would color one color to white (or any color) in javascript Fade does, but my code does not work in firebug, the error is called this.countDown.bind function but I have defined the countdown as the function You can see in the code below. Please someone can show me that I am wrong. Here is my code:

  var fadingObject = {yellowColor: function (val) {var r = 'ff', g = 'ff', b = val.toString (16), newval = '#' + R + G + B; Return Nuval; }, Fade: function (id, start, end) {this.start = start; This.count = this.start; This.finish = Finish; This.id = ID; This.countDown = function () {this.count + = 30; If (this.count> = this.finish) {document.getElementById (this.id) .style.background = 'Transparent'; This.countDown = Zero; Return; } Document.getElementById (this.id) .style.backgroundColor = this.yellowColor (this.count); SetTimeout (this.countDown.bind (this), 100); }}};   

HTML (if necessary):

  & lt; Div id = "one" & gt; & Lt; P & gt; Keep control and rewrite fun and fast. The snippets are automated ... & lt; / P & gt; & Lt; / Div & gt;    

This codedown is a JavaScript function. So, do not you have any hair objects (i.e. what has been binded), do I miss something to drill down?

Comments