Method: hasPage: Difference between revisions

From Turn.js Documentation
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 17: Line 17:
Example:
Example:
<pre class="javascript">
<pre class="javascript">
if ($("#flipbook").turn("hasPage", 1)) {
function checkPage(page)  {
alert(‘Page 1 is already in the flipbook’);
  if ($("#flipbook").turn("hasPage", page)) {
    alert("Page "+page+" is already in the flipbook");
  }
}
}
// Check if page 1 is in the flipbook
checkPage(1);
</pre>
</pre>


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

Latest revision as of 06:20, 26 November 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");
  }
}

// Check if page 1 is in the flipbook

checkPage(1);

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