Hi,

Is this what you mean?

var test = new TestClass();
                
                function TestClass() {
                        
                        function callback() {
                                alert('fired!');        
                        }

                        function doSomething() {
                                
                                $(document).keypress(callback);
                        }

                        //
                        doSomething();
                };
                


Webunity | Gilles van den Hoven wrote:
> Hi Guys,
> 
> How can i bind/unbind an event to a specific function of a class?
> 
> e.g.
> 
> class {
>     somecallback() {
>     },
>     somefunc() {
>         $(document).keypress(this.somecallback);
>     },
>     otherfunc() {
>         $(document).unkeypress(this.somecallback);
>     }
> }
> 
> Is this possible?
> 
> Thanx,
> 
> Gilles
> 
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to