Code Snippet - ctrl + i in javascript

		var ctrlKey = false;

		$(document).bind('keydown',function(event){
			if(event.keyCode == 17) {
				ctrlKey = true;
			} 

			if (ctrlKey & event.keyCode == 73) {
				alert('ctrl+i'); 			
			}
		}); 

		$(document).bind('keyup',function(event){
			if(event.keyCode == 17) {
				ctrlKey = false;
			}
		});

你可能感兴趣的:(Code Snippet - ctrl + i in javascript)