- Home /
if statement error
// Update horizontal scrollbar
if (this.options.hScrollBar && this.scrollX) {
this.scrollBarX = new scrollbar('horizontal', this.wrapper);
this.scrollBarX.init(this.scrollWidth, this.element.offsetWidth);
} else if (this.scrollBarX) {
this.scrollBarX = this.scrollBarX.remove();
}
// Update vertical scrollbar
if (this.options.vScrollBar && this.scrollY) {
this.scrollBarY = new scrollbar('vertical', this.wrapper);
this.scrollBarY.init(this.scrollHeight, this.element.offsetHeight);
} else if (this.scrollBarY) {
this.scrollBarY = this.scrollBarY.remove();
}
},
get x() {
return this._x;}
}
get y() {
return this._y;
},
setPosition: function (x, y) {
this._x = x !== null ? x : this._x;
this._y = y !== null ? y : this._y;
this.element.style.webkitTransform = 'translate3d(' + this._x + 'px,' + this._y + 'px,0)';
// Move the scrollbars
if (this.scrollBarX) {
this.scrollBarX.setPosition(this.scrollBarX.maxScroll / this.maxScrollX * this._x);
}
if (this.scrollBarY) {
this.scrollBarY.setPosition(this.scrollBarY.maxScroll / this.maxScrollY * this._y);
}
}, in the part get x() it says unexpected token get and expecting , found x ive read a couple of Q&A's and im thinking it has something to do with the whole IF part at the beggining a couple of days ago i saw an answer that might help so while im waiting for an answer here ill go in search of that one thanks in advance for any help!!!!
Comment
Answer by Lo0NuhtiK · Dec 16, 2011 at 02:17 AM
Idk if it's typo's from when you put this code on the site or not, but you've got at least 3 stray "," comma's after closing curly-brace's "}" that I saw... and a couple of extra "}" as well...
if (this.options.hScrollBar && this.scrollX) {
this.scrollBarX = new scrollbar('horizontal', this.wrapper);
this.scrollBarX.init(this.scrollWidth, this.element.offsetWidth);
}
else if (this.scrollBarX) {
this.scrollBarX = this.scrollBarX.remove();
}
// Update vertical scrollbar
if (this.options.vScrollBar && this.scrollY) {
this.scrollBarY = new scrollbar('vertical', this.wrapper);
this.scrollBarY.init(this.scrollHeight, this.element.offsetHeight);
}
else if (this.scrollBarY) {
this.scrollBarY = this.scrollBarY.remove();
}
}, //!!!!!!!!!!!!<<--------- }, --------------------------- ?????
get x() {
return this._x;}
} //!!!------- } --- already have bracket "return this._x;}" above here---
get y() {
return this._y;
}, //!!!!!!!----------- , ------------------------ ???
setPosition: function (x, y) {
this._x = x !== null ? x : this._x;
this._y = y !== null ? y : this._y;
this.element.style.webkitTransform = 'translate3d(' + this._x + 'px,' + this._y + 'px,0)';
// Move the scrollbars
if (this.scrollBarX) {
this.scrollBarX.setPosition(this.scrollBarX.maxScroll / this.maxScrollX * this._x);
}
if (this.scrollBarY) {
this.scrollBarY.setPosition(this.scrollBarY.maxScroll / this.maxScrollY * this._y);
}
}, //!!----------- , -------- ??
Your answer
Follow this Question
Related Questions
No appropriate version of 'UnityEngine.Object.Instantiate. Please Help :( 1 Answer
SCRIPT NOT WORKING 2 Answers
Mesh Inertia Tensor? 1 Answer
shield if hit get visible? 0 Answers
Error expecting ) found | 4 Answers