I've got something like the following:
MyShape = function() {
var _container = {
width: 100,
height: 100
}
this.draw() {
//do stuff...
}
$('#slider-1').bind('change', function(event, ui) {
_container.width = $('#slider-1').val();
this.draw();
});
};
I'm using the jquery slider to dynamically change the width of my shape, then I call .draw() to redraw the shape. I keep getting this error though:
Uncaught TypeError: Object # has no method 'draw'
I'm fairly sure it's because I need to pass the context "this" into the change function, but I can't seem to figure out how to do that.