Documentation
Introduction
ImageFlow is an object-oriented script, that means you can create many instances of it on one website. With multiple instances comes the whish to customize each instance differently. This can easily be done by passing an JavaScript object with specific properties and values to an ImageFlow instance.
Create an options object
JavaScript offers two possible ways to define an object. The following examples both create an options
object with the properties one
and two
.
Since the second example is shorter and the {}
syntax is very clean we stick to that notation.
Pass an JavaScript object to an ImageFlow instance
In the file imageflow.js you will find two lines within the domReady
function at the bottom. The first line instantiates a new ImageFlow object with the variable name instanceOne
. The second line calls the init
method of the newly created instance.
The interesting part here is, that the there is one parameter passed to the init
method: an JavaScript object with the option property ImageFlowID
containing the the string 'myImageFlow'.
There are many option properties that you can use to configurate an ImageFlow instance to fit your needs. Take a look at the options page for a in-depth documentation.