blasten / turn.js

The page flip effect for HTML5
www.turnjs.com
Other
7.2k stars 2.47k forks source link

Trying to remove unneeded pages from flipbook using Steve Jobs sample #686

Open andrewrkaufman2001 opened 2 months ago

andrewrkaufman2001 commented 2 months ago

I have about 83 pages in my flipbook that I made using the Steve Jobs sample project. I'm trying to remove the rest of the pages so it goes from my last page directly to the back book jacket.

I've tried changing "pages:112" in index.html to "pages:83" (as seen below), but everytime I change the number my whole flipbook disappears.

flipbook.turn({ elevation: 50, acceleration: !isChrome(), autoCenter: true, gradients: true, duration: 1000, pages: 112, when: {

Any help would be much appreciated!

Wolli4711 commented 1 month ago

You have to change the max numbers of pages also in file ../css/.css and ../jr/.jr

index.html :

flipbook.turn({ ... when: { turning: function(e, page, view) { ... if (page<book.turn('pages')) $('.sj-book .p82').addClass('fixed'); else $('.sj-book .p82').removeClass('fixed'); ... +++++++++++++++++++++++

*.css :

.sj-book .p1, .sj-book .p2, .sj-book .p3, .sj-book .p82, .sj-book .p83{ background-color:white; background-image:url("../pics/book-covers.jpg") !important; } ... .sj-book .p82{ background-position:-1024px 0 !important; }

.sj-book .p83{ background-position:-1536px 0 !important; } +++++++++++++++++++++++

*.js :

function updateDepth(book, newPage) { ... if (newPage<pages-3) $('.sj-book .p82 .depth').css({ width: depthWidth, right: 20 - depthWidth }); else $('.sj-book .p82 .depth').css({width: 0}); } +++++++++++++++++++++++

andrewrkaufman2001 commented 1 month ago

I tried making all these changes, but whenever i go into index.html and change 112 to 82 i get the blank white screen

flipbook.turn({ elevation: 50, acceleration: !isChrome(), autoCenter: true, gradients: true, duration: 1000, pages: 112, when: {

Wolli4711 commented 1 month ago

please check the maximum number of pages. It must be even. 84 instead of 83.

Wolli4711 commented 1 month ago

index.html:

...
<div id="canvas">
    <div id="book-zoom">
        <div class="sj-book">
            <div depth="5" class="hard">
                <div class="side"></div>
            </div>
            <div depth="5" class="hard front-side">
                <div class="depth"></div>
            </div>
            <div class="own-size"></div>
            <div class="own-size even"></div>
            <div class="hard fixed back-side p83">
                <div class="depth"></div>
            </div>
            <div class="hard p84"></div>
        </div>
    </div>
</div>
...