If you use the this keyword in events you'll most likely need to bind thisto
the event function - like so:
heading.addEvent('click', function(){
// yada yada
this.hideAll(i);
// yada yada
}.bind(this));
It's basically also what's giving you that TypeError when you try to fire
Slider.initialize on domready
... But - that part it superflous; MooTools Classes automatically call
their initialize method on creation. Which means you're actually firing it
twice! - so no need to have it run on domready.
what you should be doing is something like:
var Slider; // to define Slider in the global scope
window.addEvent('domready', function () {
Slider = new MooFAQ();
Slider.slide();
Slider.loadHash();
});
On Wednesday, September 12, 2012 10:06:24 PM UTC+2, Douglas Machado wrote:
>
> Greetings,
>
> I'm having a hard time to make a method to work correctly and I appreciate
> if anyone could help me out;
>
> I have uploaded the script to this JSFiddle:
> http://jsfiddle.net/machadoug/LPVkv/1/
>
> It is not executing this method below
> this.hideAll(i);
>
> Also, if I uncomment this.setOptions() I get this error in Firebug's
> console:
>
> TypeError: this.setOptions is not a function
>
>
> Thanks in advanced for your help,
>