Method: hasPage
From Turn.js Documentation
(Difference between revisions)
Line 17: | Line 17: | ||
Example: | Example: | ||
<pre class="javascript"> | <pre class="javascript"> | ||
− | if ($("#flipbook").turn("hasPage", | + | function checkPage(page) { |
− | + | if ($("#flipbook").turn("hasPage", page)) { | |
+ | alert("Page "+page+" is already in the flipbook"); | ||
+ | } | ||
} | } | ||
+ | |||
+ | checkPage(1); | ||
</pre> | </pre> | ||
<yambe:breadcrumb>Turn Methods</yambe:breadcrumb> | <yambe:breadcrumb>Turn Methods</yambe:breadcrumb> |
Revision as of 09:28, 6 July 2012
Returns true if the flipbook has a page.
Parameter | Type | Description | Default Value |
---|---|---|---|
pageNumber | Number | Page Number | You must specify this parameter |
Example:
function checkPage(page) { if ($("#flipbook").turn("hasPage", page)) { alert("Page "+page+" is already in the flipbook"); } } checkPage(1);