CodeHunger / Jarallax

Parallax scrolling library javascript
GNU General Public License v2.0
165 stars 20 forks source link

Image sequenceses #29

Open CodeHunger opened 12 years ago

CodeHunger commented 12 years ago
jarallax.addImageSequence(<container>,<properties>, <callback>)

<properties> = {bitmapName:<bitmap name>, amount:<amount of bitmaps>, start:<start progress>, end:<end progress>}

Ads an image sequence to Jarallax which swaps images based on progress.

example:

jarallax.addImageSequence('#container', {bitmapName:'box', amount:5, start:'0%', end:'100%', myCallback})

This puts the images sequence in #container. Images loaded are based on the bitmap name. Loaded images in this example are:

box0.jpg
box1.jpg
box2.jpg
box3.jpg
box4.jpg
box5.jpg

The image sequence starts at progress 0% and ends at progress 100%. When a image is loaded the 'myCallback' function is called. The first argument of this function call contains event data.

{
target:<image sequence instance>,
amountOfImages:<amount of images>,
TotalImages:<total amount of images>,
imageName:<image name>
}