I’m trying to implement this scroller function, and it should work, but when I try, it is giving me a syntax error. Can someone tell me why/how to fix it?
Scroller = function(element) {
this.element = this;
this.startTouchY = 0;
this.animateTo(0);
element.addEventListener('touchstart', this, false);
element.addEventListener('touchmove', this, false);
element.addEventListener('touchend', this, false);
}
I’m sure I have to change Scroller = function(element), but I don’t know to what.
This:
Should be this:
The difference is I replaced the styled quotes with normal single quotes. Did you program this in Word or something?!
You should also change this:
To this: