demos/demos/mediaelement/assets/jquery.colorbox.js
function addBindings() {
		if ($box) {
			if (!init) {
				init = true;

				// Cache values needed for size calculations
				interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
				interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
				loadedHeight = $loaded.outerHeight(true);
				loadedWidth = $loaded.outerWidth(true);
				
				// Setting padding to remove the need to do size conversions during the animation step.
				$box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth});

				// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
				$next.click(function () {
					publicMethod.next();
				});
				$prev.click(function () {
					publicMethod.prev();
				});
				$close.click(function () {
					publicMethod.close();
				});
				$overlay.click(function () {
					if (settings.overlayClose) {
						publicMethod.close();
					}
				});
				
				// Key Bindings
				$(document).bind('keydown.' + prefix, function (e) {
					var key = e.keyCode;
					if (open && settings.escKey && key === 27) {
						e.preventDefault();
						publicMethod.close();
					}
					if (open && settings.arrowKey && $related[1]) {
						if (key === 37) {
							e.preventDefault();
							$prev.click();
						} else if (key === 39) {
							e.preventDefault();
							$next.click();
						}
					}
				});

				$('.' + boxElement, document).live('click', function (e) {
			        // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
			        // See: http://jacklmoore.com/notes/click-events/
			        if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {
			            e.preventDefault();
			            launch(this);
			        }
			    });
			}
			return true;
		}
		return false;
	}
function addBindings() {
		if ($box) {
			if (!init) {
				init = true;

				// Cache values needed for size calculations
				interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
				interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
				loadedHeight = $loaded.outerHeight(true);
				loadedWidth = $loaded.outerWidth(true);
				
				// Setting padding to remove the need to do size conversions during the animation step.
				$box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth});

				// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
				$next.click(function () {
					publicMethod.next();
				});
				$prev.click(function () {
					publicMethod.prev();
				});
				$close.click(function () {
					publicMethod.close();
				});
				$overlay.click(function () {
					if (settings.overlayClose) {
						publicMethod.close();
					}
				});
				
				// Key Bindings
				$(document).bind('keydown.' + prefix, function (e) {
					var key = e.keyCode;
					if (open && settings.escKey && key === 27) {
						e.preventDefault();
						publicMethod.close();
					}
					if (open && settings.arrowKey && $related[1]) {
						if (key === 37) {
							e.preventDefault();
							$prev.click();
						} else if (key === 39) {
							e.preventDefault();
							$next.click();
						}
					}
				});

				$('.' + boxElement, document).live('click', function (e) {
			        // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
			        // See: http://jacklmoore.com/notes/click-events/
			        if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {
			            e.preventDefault();
			            launch(this);
			        }
			    });
			}
			return true;
		}
		return false;
	}
function addBindings ( ) { if ( $box ) { if ( ! init ) { init = true ; // Cache values needed for size calculations interfaceHeight = $topBorder . height ( ) + $bottomBorder . height ( ) + $content . outerHeight ( true ) - $content . height ( ) ; //Subtraction needed for IE6 interfaceWidth = $leftBorder . width ( ) + $rightBorder . width ( ) + $content . outerWidth ( true ) - $content . width ( ) ; loadedHeight = $loaded . outerHeight ( true ) ; loadedWidth = $loaded . outerWidth ( true ) ; // Setting padding to remove the need to do size conversions during the animation step. $box . css ( { "padding-bottom" : interfaceHeight , "padding-right" : interfaceWidth } ) ; // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly. $next . click ( function ( ) { publicMethod . next ( ) ; } ) ; $prev . click ( function ( ) { publicMethod . prev ( ) ; } ) ; $close . click ( function ( ) { publicMethod . close ( ) ; } ) ; $overlay . click ( function ( ) { if ( settings . overlayClose ) { publicMethod . close ( ) ; } } ) ; // Key Bindings $ ( document ) . bind ( 'keydown.' + prefix , function ( e ) { var key = e . keyCode ; if ( open && settings . escKey && key === 27 ) { e . preventDefault ( ) ; publicMethod . close ( ) ; } if ( open && settings . arrowKey && $related [ 1 ] ) { if ( key === 37 ) { e . preventDefault ( ) ; $prev . click ( ) ; } else if ( key === 39 ) { e . preventDefault ( ) ; $next . click ( ) ; } } } ) ; $ ( '.' + boxElement , document ) . live ( 'click' , function ( e ) { // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt. // See: http://jacklmoore.com/notes/click-events/ if ( ! ( e . which > 1 || e . shiftKey || e . altKey || e . metaKey ) ) { e . preventDefault ( ) ; launch ( this ) ; } } ) ; } return true ; } return false ; }
Add ColorBox's event bindings
Add ColorBox s event bindings