Skip to content

Page flippers

joseph edited this page Sep 4, 2011 · 1 revision

Flippers are objects that follow a defined interface, and do the hard labour of actually turning the page. They typically listen for user interaction of some kind, then tell the reader that they are changing the page.

Flippers must be a 'class' (ie, instantiable via 'new') — the reader does the instantiation.

You can set the flipper as an option to the Reader initialization command, eg:

var reader = Monocle.Reader('someElementId', null, { flipper: MyFlipper });

Monocle comes with three built in flipper classes:

  • Monocle.Flippers.Slider - the animated, sliding page turns (default)
  • Monocle.Flippers.Scroller - text rolls across the screen, like a scroll
  • Monocle.Flippers.Instant - pages immediately change, without animation

Creating your own flipper

To create a new kind of flipper, your object must implement the methods and properties of the flipper interface. The flipper interface is as follows.

Constructor arguments:

  • reader

Properties:

  • pageCount - must be an integer

Methods:

  • addPage(pageDiv)
  • getPlace(pageDiv)
  • moveTo(locus)
  • listenForInteraction()
Clone this wiki locally
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy