tags:

views:

36

answers:

1

Hi all,

I tried being specific in the title, I hope it explained what I meant. I've got several control in my web page. Some of them are quite complex, built by other people, and some of them I cannot change.

Now, I wanted to add my own functionality to certain controls, say... User hovers over a button and show him an image. Problem is, that when I start writing my own jquery event handlers for example:

 $('div#special_div').click(function() {
               alert('clicked');
           })

the original event handlers won't work.

Any ideas why this happens?

+2  A: 

I just tried creating two click events on jquery home page and it should actually work:

$( "#jq-header" ).click( function( ) { alert( "moo" ); } );
$( "#jq-header" ).click( function( ) { alert( "moo2" ); } );

My previous answer where I said it replaced events was wrong.

apphacker
I don't think that's true. It's definitely possible to bind multiple independent functions to the same element for the same event with the jQuery binding system.
Pointy
That is correct I just tried it I'm completely wrong.
apphacker