mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-30 19:00:09 +00:00 
			
		
		
		
	added several gesture plugins support, still flaky...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									05ea6be1cf
								
							
						
					
					
						commit
						421e6bd32e
					
				| @ -28,6 +28,7 @@ TODO: | |||||||
| - make all the code relative to the current selection (multiple instances on a page support) | - make all the code relative to the current selection (multiple instances on a page support) | ||||||
| - make this into a jquery plugin... | - make this into a jquery plugin... | ||||||
| - add dynamic loading and unloading for very large sets... | - add dynamic loading and unloading for very large sets... | ||||||
|  | - gesture support... | ||||||
| 
 | 
 | ||||||
| - first stage refactoring: | - first stage refactoring: | ||||||
| 	- merge almost identical functions... | 	- merge almost identical functions... | ||||||
| @ -38,8 +39,19 @@ ISSUES: | |||||||
| --> | --> | ||||||
| 
 | 
 | ||||||
| <script src="jquery.js"></script> | <script src="jquery.js"></script> | ||||||
|  | 
 | ||||||
|  | <!-- XXX this does not work on android... -->  | ||||||
| <script src="jquery.gestures.js"></script> | <script src="jquery.gestures.js"></script> | ||||||
|  | 
 | ||||||
|  | <!-- XXX need to figure out how to disable all the bling --> | ||||||
|  | <!-- script src="jquery.mobile.js"></script--> | ||||||
| <script> | <script> | ||||||
|  | /* | ||||||
|  | $(document).bind("mobileinit", function(){ | ||||||
|  | 	e.preventDefault() | ||||||
|  | }); | ||||||
|  | */ | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| $(document).ready(function() { | $(document).ready(function() { | ||||||
| 	// current state... | 	// current state... | ||||||
| @ -53,14 +65,27 @@ $(document).ready(function() { | |||||||
| 	// setup event handlers... | 	// setup event handlers... | ||||||
| 	$(document) | 	$(document) | ||||||
| 		.keydown(handleKeys) | 		.keydown(handleKeys) | ||||||
|  | 		// XXX does not work on android... | ||||||
| 		.gestures({eventHandler: handleGestures}) | 		.gestures({eventHandler: handleGestures}) | ||||||
|  | 		/* XXX jquery.mobile handlers... | ||||||
|  | 		.bind('swipeleft', function(e){ | ||||||
|  | 			nextImage() | ||||||
|  | 			e.preventDefault() | ||||||
|  | 			return false | ||||||
|  | 		}) | ||||||
|  | 		.bind('swiperight', function(e){ | ||||||
|  | 			prevImage() | ||||||
|  | 			e.preventDefault() | ||||||
|  | 			return false | ||||||
|  | 		}) | ||||||
|  | 		*/ | ||||||
| 	$(".image").click(handleClick) | 	$(".image").click(handleClick) | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 	// set the default position... | 	// set the default position... | ||||||
| 	$('.current-image').click() | 	$('.current-image').click() | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | // XXX jquery.gestures handler... | ||||||
| function handleGestures(e){ | function handleGestures(e){ | ||||||
| 	switch (e){ | 	switch (e){ | ||||||
| 		case 'N': | 		case 'N': | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user