blasten / turn.js

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

How to load each page dynamically. #639

Open testingmic opened 4 years ago

testingmic commented 4 years ago

I each new page that will be called to be fetched dynamically. Sample code below. The error is get is, on content of the PHP file appears about 3 times before it changes.

Page 1

var flipbook = $("#flipbook");

flipbook.turn({ elevation: 50, width: 800, height: 500, autoCenter: false, display: 'single', pages: 10, duration: 1000, when: { turned: function(e, page, view) { addPage(2, $(this)); }, missing: function (e, pages) { for (var i = 0; i < pages.length; i++) { addPage(pages[i], $(this)); } } } });

function loadPage(page) { $.ajax({ url: '/turnjs4/samples/processor.php' }).done(function(pageHtml) { $('#flipbook .p' + page).html(pageHtml); }); }

function addPage(page, book) { var id, pages = book.turn('pages'); var element = $('

', {'class': 'own-size', css: {width: 460, height: 582} }). html('
Loading...
'); if (book.turn('addPage', element, page)) { loadPage(page); } }

testingmic commented 4 years ago

No please i could not get any help

On Tue, Oct 22, 2019 at 10:18 AM FighterLong notifications@github.com wrote:

问题解决了吗 Has the problem been solved

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/blasten/turn.js/issues/639?email_source=notifications&email_token=AKDVQVGX7434NJRCBX5K6OLQP3HPXA5CNFSM4IJ6VMEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB5HEBA#issuecomment-544895492, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDVQVDHNZ6TVVZKYYKBJ3TQP3HPXANCNFSM4IJ6VMEA .

-- Emmanuel Obeng - Software Developer, Analitica Innovare Address: No 5, Wu-Biibi Lane, Accra

Telephone: +233.302934717 / +233.238758175 Email: emmanuel.obeng@analiticainnovare.com emmanuel.obeng@analiticainnovare.com Website: https://analiticainnovare.com https://analiticainnovare.com/

testingmic commented 4 years ago

No please i could not get any help