Views
Actions

Event: missing

From Turn.js Documentation
(Difference between revisions)
Jump to: navigation, search
 
Line 19: Line 19:
 
<pre class="javascript">
 
<pre class="javascript">
 
$("#flipbook").bind("missing", function(event, pages) {
 
$("#flipbook").bind("missing", function(event, pages) {
for (var i = 0; i < pages.length; i++) {
+
  for (var i = 0; i < pages.length; i++) {
$(this).turn("addPage", $("<div />"), pages[i]);
+
    $(this).turn("addPage", $("<div />"), pages[i]);
}
+
  }
 
});
 
});
 
</pre>
 
</pre>

Latest revision as of 23:38, 25 November 2012

This event is triggered when some pages are required in the current range.

Argument Type Description
event Object Event Object
pages Array Pages having to be added

Example:

$("#flipbook").bind("missing", function(event, pages) {
  for (var i = 0; i < pages.length; i++) {
    $(this).turn("addPage", $("<div />"), pages[i]);
  }
});

[edit] See also

Method: addPage

Main Page > API > Turn Events > Event: missing