Turn.js can't seem to center flipbook in browser window

5.2k views Asked by At

Turn.js's autoCenter property changes the margin-left of the #flipbook, in order to keep the images inside the flipbook virtually centered. However, I want the flipbook centered within my browser, but autoCenter affects putting margin: 0 auto; on the #flipbook.

Is there any way I can make both the flipbook centered in the browser window, and have the autoCenter property turned on so that I don't have to write the double-page view autoCenter'ing functionality myself with JavaScript?

1

There are 1 answers

3
Alberto On BEST ANSWER

The flipbook is working on the #flipbook element , which I suppose it's a 'div' element, right ?

So the script should center only the objects inside the div... Now, try entering this 'div' into an other one like:

//HTML..
<div id="container" style="position:absolute;width: 50%;
    margin: 0px auto;">

       <div id="flipbook" style="position:relative">
       //Script works here
       </div>
</div>
//HTML..

Sorry if this didn't help you..

Try providing some code to help me solving your problem..