right( $( "img:eq(1)" ), animate );
left( $( "img:eq(2)" ).prependTo( "#container" ) );
}
- $( "#previous" ).click( previous );
- $( "#next" ).click( next );
+ $( "#previous" ).on( "click", previous );
+ $( "#next" ).on( "click", next );
- $( "img" ).click(function( event ) {
+ $( "img" ).on( "click", function( event ) {
$( "img" ).index( this ) === 0 ? previous( event ) : next( event );
});
- $( window ).resize(function() {
+ $( window ).on( "resize", function() {
left( $( "img:eq(0)" ), animate );
center( $( "img:eq(1)" ), animate );
right( $( "img:eq(2)" ), animate );
$( ".positionable" ).css( "opacity", 0.5 );
- $( "select, input" ).bind( "click keyup change", position );
+ $( "select, input" ).on( "click keyup change", position );
$( "#parent" ).draggable({
drag: position
drag: function() { position(); }
});
- $( "#within" ).click(function() {
+ $( "#within" ).on( "click", function() {
within = within.is( ".demo" ) ? $( window ) : $( ".demo" );
position();
});
- $( "#margin" ).click(function() {
+ $( "#margin" ).on( "click", function() {
positionable.toggleClass( "extra-margin" );
position();
});
- $( "select, input" ).bind( "click keyup change", function() { position(); } );
+ $( "select, input" ).on( "click keyup change", function() { position(); } );
position();
});
using: using
};
};
- $( document ).bind( "mousemove", function( event ) {
+ $( document ).on( "mousemove", function( event ) {
element.position( positionWithOffset(
event.pageX - targetOffset.left, event.pageY - targetOffset.top ) );
oppositeElement.position( positionWithOffset(