mirror of
				https://github.com/flynx/PortableMag.git
				synced 2025-10-31 20:10:13 +00:00 
			
		
		
		
	removed doctype (broke everything), started migrating to a more general sizeing method...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									95cd7aaab8
								
							
						
					
					
						commit
						e7a5f3e5a8
					
				| @ -1,3 +1,5 @@ | |||||||
|  | <!-- XXX for some reason a doctype kills the layout, need to investigate --> | ||||||
|  | <!--DOCTYPE html--> | ||||||
| <html> | <html> | ||||||
| <head> | <head> | ||||||
| <title>Magazine</title> | <title>Magazine</title> | ||||||
| @ -87,7 +89,8 @@ $(document).ready(function(){ | |||||||
| 			}, | 			}, | ||||||
| 
 | 
 | ||||||
| 			//excludedElements: '.noSwipe', | 			//excludedElements: '.noSwipe', | ||||||
| 			fingers: $.fn.swipe.fingers.ALL | 			//fingers: $.fn.swipe.fingers.ALL | ||||||
|  | 			fingers: $.fn.swipe.fingers.THREE | ||||||
| 		}) | 		}) | ||||||
| 
 | 
 | ||||||
| 	// XXX do we need these here?? | 	// XXX do we need these here?? | ||||||
|  | |||||||
							
								
								
									
										11
									
								
								magazine.css
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								magazine.css
									
									
									
									
									
								
							| @ -68,7 +68,6 @@ body { | |||||||
| 
 | 
 | ||||||
| .page .bookmark { | .page .bookmark { | ||||||
| 	position: absolute; | 	position: absolute; | ||||||
| 	font-size: 0px; |  | ||||||
| 	width: 100px; | 	width: 100px; | ||||||
| 	height: 100px; | 	height: 100px; | ||||||
| 
 | 
 | ||||||
| @ -82,11 +81,11 @@ body { | |||||||
| 	z-index: 9999; | 	z-index: 9999; | ||||||
| 	opacity: 0,5; | 	opacity: 0,5; | ||||||
| 
 | 
 | ||||||
| 	-webkit-transform: rotate(45deg); | 	-webkit-transform: rotate(-45deg); | ||||||
| 	-moz-transform: rotate(45deg); | 	-moz-transform: rotate(-45deg); | ||||||
| 	-o-transform: rotate(45deg); | 	-o-transform: rotate(-45deg); | ||||||
| 	-ms-transform: rotate(45deg); | 	-ms-transform: rotate(-45deg); | ||||||
| 	transform: rotate(45deg); | 	transform: rotate(-45deg); | ||||||
| 
 | 
 | ||||||
| 	-webkit-transition: all 0.2s ease; | 	-webkit-transition: all 0.2s ease; | ||||||
| 	-moz-transition: all 0.2s ease; | 	-moz-transition: all 0.2s ease; | ||||||
|  | |||||||
							
								
								
									
										20
									
								
								magazine.js
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								magazine.js
									
									
									
									
									
								
							| @ -78,11 +78,13 @@ function getPageNumber(page){ | |||||||
| 	return $('.page').index(page)  | 	return $('.page').index(page)  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| function getPageAt(n){ | function getPageAt(n){ | ||||||
| 	return $($('.page')[n]) | 	return $($('.page')[n]) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| /************************************************** event handlers ***/ | /************************************************** event handlers ***/ | ||||||
| 
 | 
 | ||||||
| // hash url handler...
 | // hash url handler...
 | ||||||
| @ -137,17 +139,11 @@ function swipeHandler(evt, phase, direction, distance, duration, fingers){ | |||||||
| 			&& (direction=='left' || direction=='right')){ | 			&& (direction=='left' || direction=='right')){ | ||||||
| 		// using the "unanimated" trick we will make the drag real-time...
 | 		// using the "unanimated" trick we will make the drag real-time...
 | ||||||
| 		if(direction == 'left'){ | 		if(direction == 'left'){ | ||||||
| 			if(_USE_REAL_SIZES){ | 			mag.css({left: -cur.position()['left']/scale - distance/scale}) | ||||||
| 				mag.css({left: -cur.position()['left']/scale-distance/scale}) | 			//mag.css({left: -n*cur.width()-distance/scale})
 | ||||||
| 			} else { |  | ||||||
| 				mag.css({left: -n*cur.width()-distance/scale}) |  | ||||||
| 			} |  | ||||||
| 		} else if(direction == 'right') { | 		} else if(direction == 'right') { | ||||||
| 			if(_USE_REAL_SIZES){ | 			mag.css({left: -cur.position()['left']/scale + distance/scale}) | ||||||
| 				mag.css({left: -cur.position()['left']/scale+distance/scale}) | 			//mag.css({left: -n*cur.width()+distance/scale})
 | ||||||
| 			} else { |  | ||||||
| 				mag.css({left: -n*cur.width()+distance/scale}) |  | ||||||
| 			} |  | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		$('.viewer').trigger('magazineDragging') | 		$('.viewer').trigger('magazineDragging') | ||||||
| @ -335,11 +331,7 @@ function setCurrentPage(n, offset, width){ | |||||||
| 	cur.addClass('current') | 	cur.addClass('current') | ||||||
| 
 | 
 | ||||||
| 	var mag = $('.magazine') | 	var mag = $('.magazine') | ||||||
| 	if(_USE_REAL_SIZES){ |  | ||||||
| 	var offset = offset == null ? cur.position()['left']/getPageScale() : offset | 	var offset = offset == null ? cur.position()['left']/getPageScale() : offset | ||||||
| 	} else { |  | ||||||
| 		var offset = offset == null ? cur.width()*n : offset |  | ||||||
| 	} |  | ||||||
| 	mag.css({left: -offset}) | 	mag.css({left: -offset}) | ||||||
| 
 | 
 | ||||||
| 	// center the pages correctly...
 | 	// center the pages correctly...
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user