According with the documentation (http://www.turnjs.com/docs/Method:_addPage) you can add dinamically pages. So when the page is loaded you can custom split your pages and add them dinamically. Something like this.
Imagine this HTML:
<div class="page">
<h2>Title</h2>
<p>Content</p>
</div>
<div class="page">
<h2>Title</h2>
<p>Content</p>
</div>
<div class="page">
<h2>Title</h2>
<p>Content</p>
</div>
<div class="page">
<h2>Title</h2>
<p>Content</p>
</div>
<div id="flipbook"></div>
We have here 4 pages but there are all in the same page, and the last element is where flipbook will be constructed. So when we load the page let's split them in Javascript:
$(document).ready(function() {
// initialize the flipbook
$("#flipbook").turn({page: 1, acceleration: true, gradients: true});
// first we declare an array to store pages contents
var pagesArray = [];
$('.page').each(function() {
// iterate through all pages and store the HTML inside
pagesArray.push($(this).html());
});
// iterate the array and add pages dinamically
for(var i in pagesArray) {
// add the element within a div with the content that store before
var element = $("<div />").html(pagesArray[i]);
// add the page with the counter + 1 (first page is 1 not 0)
$("#flipbook").turn("addPage", element, (i+1));
}
});
And that's all.
Tell us if this fits with your requirements. If not, please, share with us your html structure to view how to solve the problem.
tags too which tells it as next chapter. And this should be moved to next page.. But there are number of
tags between each
tags. So I cant just move based on chapters only
– Haris Nov 12 '15 at 13:26