var innerHTML; if(this.count==1){ innerHTML = this._genHTML(50, 0); }else{ var i; var interval = 100 / (this.count-1); if(!this._isHorizontal || this.isLeftToRight()){ innerHTML = this._genHTML(0, 0); for(i=1; i < this.count-1; i++){ innerHTML += this._genHTML(interval*i, i); } innerHTML += this._genHTML(100, this.count-1); }else{ innerHTML = this._genHTML(100, 0); for(i=1; i < this.count-1; i++){ innerHTML += this._genHTML(100-interval*i, i); } innerHTML += this._genHTML(0, this.count-1); } } this.domNode.innerHTML = innerHTML;