New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS orientation single and double page flipping #172
Comments
@ryHollingsworth Fantastic, Thanks! An upcoming version might include an option called responsive that will handle EVERYTHING. |
@blasten Awesome, yeah I saw your youTube video with a responsive effect on it.. looking good. I have to put my progress on hold for now, but hopefully i can get back in to it.. silly other projects :) keep up the good work and thanks for all you do! |
The only way I made mine a little more responsive was calculating out the width... the problem with my implementation is that it reloads the page when the orientation changes... Which means you lose your page (and it's slow :( ) $(document).ready(function (){
setFlipbookStage();
});
$(document).bind( 'orientationchange', function(e){
window.open("index.html","_self");
});
function setFlipbookStage(){
var imgHeight = 720;
var imgWidth = 576;
var scrWidth = $('#flipbook').width();
$('.dynamic_image').css({
'max-width' : (scrWidth / 2) , 'height' : 'auto'
});
var dynHeight = Math.round((( scrWidth / 2 ) * imgHeight ) / imgWidth);
$("#flipbook").turn({
gradients: false,
width: scrWidth,
height: dynHeight,
autoCenter: true
});
} Using version 3 I looked through some of the code for turn.js (most of which was way over my head) but I noticed that it has a resize function. Was mine not working or is that only for the "stage" and not the images. |
I'm trying to use your example ryHollingsworth on the "magazine" sample. flipbook.turn({
Am I supposed to delete this initial settings or what ? My result is I keep getting an either stretch out single or really narrow double. Help ! |
No, the init settings give you the first div, that why you got a not good visibility. Actually for the first chargement with my php code I init and that my trouble actually to know if my phone was on portrait and lanscape. After that i give the init settings on PHP with a cookie to know the res width :
function Xhr_ResScreen(file){
if( window.XMLHttpRequest ){
xhr = new XMLHttpRequest();
if ( xhr.overrideMimeType ) xhr.overrideMimeType('text/html; charset=ISO-8859-1');
} else {
if ( window.ActiveXObject ){
try {
xhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
window.alert("Votre navigateur ne prend pas en charge l'objet XMLHTTPRequest.");
}
}
}
}
and after i take it for hav the resolution of my device :
$cookietime = 3600;
and take it in a php Var for display :
$EcranWidth = $_COOKIE['res_width'];
$EcranHeight = $_COOKIE['res_height'];
|
Hi, I am also trying to figure out how to make turn.js go from double to single page mode when in portrait on a phone or a tablet. I tried to implement @ryHollingsworth code, but it's not working for me. Perhaps I'm not inserting it into the right location? Have anyone else figured out how to make ? |
Hey all,
I'm currently working on making my flipbook responsive and felt I'd share my progress with the community in case there's another person out there doing the same thing. (there's a few issue threads here on the subject, but no real code pertaining to it) I'm just starting this process and expect a lot of speed bumps along the way...
here's how i'm handling screen orientation detection:
the .importPage class is my right hand page. it's a little redundant, but i haven't thought of a cleaner way of doing this yet. (my pages are dynamic) I hide/show this div class based on the orientation of the device...
which required a quick fix to the prev/next functions:
issues i'm currently facing:
Any ways, I'm done for the day with this, but thought this might be a popular topic for others and felt I'd at least share what I got done today :)
If any one has any insight I'm 100% open to it, and I hope this may help others reach their goals for their flip books!
The text was updated successfully, but these errors were encountered: