mirror of
https://github.com/flynx/PortableMag.git
synced 2025-10-29 03:00:09 +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>
|
||||
<head>
|
||||
<title>Magazine</title>
|
||||
@ -87,7 +89,8 @@ $(document).ready(function(){
|
||||
},
|
||||
|
||||
//excludedElements: '.noSwipe',
|
||||
fingers: $.fn.swipe.fingers.ALL
|
||||
//fingers: $.fn.swipe.fingers.ALL
|
||||
fingers: $.fn.swipe.fingers.THREE
|
||||
})
|
||||
|
||||
// XXX do we need these here??
|
||||
|
||||
11
magazine.css
11
magazine.css
@ -68,7 +68,6 @@ body {
|
||||
|
||||
.page .bookmark {
|
||||
position: absolute;
|
||||
font-size: 0px;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
|
||||
@ -82,11 +81,11 @@ body {
|
||||
z-index: 9999;
|
||||
opacity: 0,5;
|
||||
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
-webkit-transform: rotate(-45deg);
|
||||
-moz-transform: rotate(-45deg);
|
||||
-o-transform: rotate(-45deg);
|
||||
-ms-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
|
||||
-webkit-transition: all 0.2s ease;
|
||||
-moz-transition: all 0.2s ease;
|
||||
|
||||
22
magazine.js
22
magazine.js
@ -78,11 +78,13 @@ function getPageNumber(page){
|
||||
return $('.page').index(page)
|
||||
}
|
||||
|
||||
|
||||
function getPageAt(n){
|
||||
return $($('.page')[n])
|
||||
}
|
||||
|
||||
|
||||
|
||||
/************************************************** event handlers ***/
|
||||
|
||||
// hash url handler...
|
||||
@ -137,17 +139,11 @@ function swipeHandler(evt, phase, direction, distance, duration, fingers){
|
||||
&& (direction=='left' || direction=='right')){
|
||||
// using the "unanimated" trick we will make the drag real-time...
|
||||
if(direction == 'left'){
|
||||
if(_USE_REAL_SIZES){
|
||||
mag.css({left: -cur.position()['left']/scale-distance/scale})
|
||||
} else {
|
||||
mag.css({left: -n*cur.width()-distance/scale})
|
||||
}
|
||||
mag.css({left: -cur.position()['left']/scale - distance/scale})
|
||||
//mag.css({left: -n*cur.width()-distance/scale})
|
||||
} else if(direction == 'right') {
|
||||
if(_USE_REAL_SIZES){
|
||||
mag.css({left: -cur.position()['left']/scale+distance/scale})
|
||||
} else {
|
||||
mag.css({left: -n*cur.width()+distance/scale})
|
||||
}
|
||||
mag.css({left: -cur.position()['left']/scale + distance/scale})
|
||||
//mag.css({left: -n*cur.width()+distance/scale})
|
||||
}
|
||||
|
||||
$('.viewer').trigger('magazineDragging')
|
||||
@ -335,11 +331,7 @@ function setCurrentPage(n, offset, width){
|
||||
cur.addClass('current')
|
||||
|
||||
var mag = $('.magazine')
|
||||
if(_USE_REAL_SIZES){
|
||||
var offset = offset == null ? cur.position()['left']/getPageScale() : offset
|
||||
} else {
|
||||
var offset = offset == null ? cur.width()*n : offset
|
||||
}
|
||||
var offset = offset == null ? cur.position()['left']/getPageScale() : offset
|
||||
mag.css({left: -offset})
|
||||
|
||||
// center the pages correctly...
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user