Views
Actions

Method: hasPage

From Turn.js Documentation
(Difference between revisions)
Jump to: navigation, search
(Created page with "<yambe:breadcrumb>Turn Methods</yambe:breadcrumb>")
 
 
(6 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
Returns true if the flipbook has a page.
 +
 +
{| class="wikitable"
 +
|-
 +
! scope="col"| Parameter
 +
! scope="col"| Type
 +
! scope="col"| Description
 +
! scope="col"| Default Value
 +
|-
 +
| pageNumber
 +
| Number
 +
| Page Number
 +
| You must specify this parameter
 +
 +
|}
 +
 +
Example:
 +
<pre class="javascript">
 +
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);
 +
 +
</pre>
 +
 
<yambe:breadcrumb>Turn Methods</yambe:breadcrumb>
 
<yambe:breadcrumb>Turn Methods</yambe:breadcrumb>

Latest revision as of 23:20, 25 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);

Main Page > API > Turn Methods > Method: hasPage