Method: addPage: Difference between revisions

From Turn.js Documentation
Jump to navigation Jump to search
No edit summary
No edit summary
Line 23: Line 23:


<pre class="javascript">
<pre class="javascript">
element = $("<div />");
element = $("<div />").html("Loading...");
$("#flipbook").turn("addPage", element, 10);
$("#flipbook").turn("addPage", element, 10);
</pre>
</pre>
Line 30: Line 30:


<pre class="javascript">
<pre class="javascript">
element = $("<div />", {"class": "p10"});
element = $("<div />", {"class": "p10"}).html("Loading...");
$("#flipbook").turn("addPage", element);
$("#flipbook").turn("addPage", element);
</pre>
</pre>

Revision as of 15:52, 6 July 2012

Adds a page to the flipbook.

Parameter Type Description Default Value
element jQuery element Pointer to the DOM element of the page
$("<div />")
pageNumber Number Page Number
$("#flipbook").turn("pages")+1

To insert the page 10, you can just do:

element = $("<div />").html("Loading...");
$("#flipbook").turn("addPage", element, 10);

Or

element = $("<div />", {"class": "p10"}).html("Loading...");
$("#flipbook").turn("addPage", element);

Notice that the CSS class p10 also indicates the page number being inserted.

<yambe:breadcrumb>Turn Methods</yambe:breadcrumb>