Views
Actions

Event: start

From Turn.js Documentation
(Difference between revisions)
Jump to: navigation, search
Line 20: Line 20:
 
|}
 
|}
  
Example:
+
For example, if you want to only allows the user to interact with a corner at the bottom of the page, it code would be:
 +
 
 
<pre class="javascript">
 
<pre class="javascript">
$("#flipbook").bind("missing", function(event, page) {
+
$("#flipbook").bind("start", function(event, page, corner) {
for (var i = 0; i < pages.length; i++) {
+
if (corner=="tl" || corner=="tr") {
$(this).turn("addPage", $("<div />"), pages[i]);
+
event.preventDefault();
 
}
 
}
 
});
 
});
 
</pre>
 
</pre>
 
<yambe:breadcrumb>Turn Events</yambe:breadcrumb>
 
<yambe:breadcrumb>Turn Events</yambe:breadcrumb>

Revision as of 20:04, 6 July 2012

This event is triggered when an animation of a page starts.

Argument Type Description
event Object Event Object
page Number The page number
corner Number Corner type

For example, if you want to only allows the user to interact with a corner at the bottom of the page, it code would be:

$("#flipbook").bind("start", function(event, page, corner) {
	if (corner=="tl" || corner=="tr") {
		event.preventDefault();
	}
});
Main Page > API > Turn Events > Event: start