Some more on JQuery Binding

http://jsfiddle.net/mattgre/4vwuG/

The example is running on JFiddle and here is the code:

$( “img” ).bind( “click”, function( event ) {

var str = “( ” + event.pageX + “, ” + event.pageY + ” )”;

$( “span” ).text( “Click happened! ” + str );

});

$( “img” ).bind( “dblclick”, function() {

$( “span” ).text( “Double-click happened in ” + this.nodeName );    $( “img” ).animate({

opacity: 0.25,

left: “+=50”,

height: “toggle”

}, 5000, function() {

// Animation complete.

});

});

$( “img” ).bind( “mouseenter mouseleave”, function( event ) {

$( this ).toggleClass( “over” );

});

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s