Jquery Click or Press and Hold

Hi,

I have a task of building a button that a user can click or press and hold.

Basically it would act like a telegraph machine.

If the user presses and holds it should fire an event.

If the user clicks on the button it should fire another event.

Any ideas where to start?

Many thanks,

Justin

jQuery bind() is what your seeking, you can set multiple events to it and then have the event do something

http://api.jquery.com/bind/

For what your wanting you would use

$(document).ready(function(){
    $('#id-here').bind('click mousedown', function(){
        // Do something here
    });
});