Main Page: Difference between revisions

From Turn.js Documentation
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
The first release of turn.js introduced a pretty simple way for adding new pages. In fact, the only thing you had to do was to add as many elements as pages you needed for your book or magazine. Quickly, this scheme brought up a problem in cases where the book contained a large amount of pages. The solution was to provide a way for creating pages on the fly. Therefore, the 3rd release of turn.js allows you to create pages dynamically.The API is also simple and consistent with the way you are familiar for setting event listeners. This new feature is the foundation in which any kind of e-reader app will be achievable.
:{|
! scope="col" width="225" | Options
! scope="col" width="225" | Properties
! scope="col" width="225" | Methods
! scope="col" width="225" | Events
! scope="col" width="225" | CSS Classes


<pre class="javascript">
|-
function load() {
| valign="top" |
if (turn.browser.support()) {
* [[Option: autoCenter|acceleration]]
$('selector').turn({
* [[Option: autoCenter|autoCenter]]
elevation: 50,
* [[Option: display|display]]
acceleration: true,
* [[Option: display|duration]]
gradients: true,
* [[Option: gradients|gradients]]
autoCenter: true,
* [[Option: height|height]]
duration: 1000,
* [[Option: inclination|inclination]]
pages: 112,
* [[Option: page|page]]
width:960,
* [[Option: pages|pages]]
height:600
* [[Option: when|when]]
});
* [[Option: width|width]]
}
| valign="top" |
}
</pre>


If our reader is currently in the page 6, the view for that page will be <tt>6,7</tt>.  From <tt>6-7</tt>, turn.js wants to keep in memory 4 more pages. Therefore, our DOM and JavaScript cache will have the pages <tt>[4, 5, 6, 7, 8, 9]</tt>.  For instance, if our reader is in page 1, the pages to keep in DOM are <tt>[1, 2, 3, 4, 5, 6]</tt>. 
* [[Property: animating|animating]]
* [[Property: display|display]]
* [[Property: disabled|disabled]]
* [[Property: page|page]]
* [[Property: pages|pages]]
* [[Property: size|size]]
* [[Property: options|options]]
* [[Property: view|view]]
* [[Property: zoom|zoom]]


Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.


== Getting started ==
| valign="top"  |
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]
 
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]
* [[Method: addPage|addPage]]
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]
* [[Method: center|center]]
* [[Method: destroy|destroy]]
* [[Method: display|display]]
* [[Method: disable|disable]]
* [[Method: hasPage|hasPage]]
* [[Method: next|next]]
* [[Method: is|is]]
* [[Method: page|page]]
* [[Method: pages|pages]]
* [[Method: peel|peel]]
* [[Method: previous|previous]]
* [[Method: range|range]]
* [[Method: removePage|removePage]]
* [[Method: resize|resize]]
* [[Method: size|size]]
* [[Method: stop|stop]]
* [[Method: zoom|zoom]]
 
| valign="top"  |
 
* [[Event: end|end]]
* [[Event: first|first]]
* [[Event: last|last]]
* [[Event: missing|missing]]
* [[Event: start|start]]
* [[Event: turning|turning]]
* [[Event: turned|turned]]
* [[Event: zooming|zooming]]
 
| valign="top" |
* [[Class: .even|.even]]
* [[Class: .fixed|.fixed]]
* [[Class: .hard|.hard]]
* [[Class: .odd|.odd]]
* [[Class: .own-size|.own-size]]
* [[Class: .page|.page]]
* [[Class: .p|.p[0-9]+]]
* [[Class: .shadow|.shadow]]
* [[.Class: .sheet|sheet]]
 
|}

Revision as of 21:25, 4 July 2012