Library: blender.js
Overview
Blender.js
Loads an array of images and blends them in sequence.

Requires Prototype 1.6 (http://www.prototypejs.org) or later
and Scriptaculous 1.8 (http://script.aculo.us) or later.

Widget.Blender is licensed under the Creative Commons Attribution 2.5 South Africa License
(more information at: http://creativecommons.org/licenses/by/2.5/za/)
Under this license you are free to
- to copy, distribute and transmit the work
- to adapt the work
However you must
- You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
- That is by providing a link back to http://www.eternal.co.za or to the specific script page. This link need not be on the page using the script, or even nescessarily even on the same domain, as long as it's accessible from the site.
I'd also like an email telling me where you are using the script, although this is not required. More often than not I will link back to the site using the script.
Other than that, you may use this class in any way you like, but don't blame me if things go
pear shaped. If you use this library I'd like a mention on your website, but
it's not required. If you like it, send me an email. If you find bugs, send
me an email. If you don't like it, don't tell me: you'll hurt my feelings.
Change History:
Version 1.1.0: 7 Dec 2007
- Updated script for Prototype 1.6 and Scriptaculous 1.8
- Blender is now in the Widget namespace (Widget.Blender).
- Blender no longer requires Scriptactulous Builder and uses Prototypes new Element(...) instead.
- Minified script and minified single script files added to download.
- New license: Creative Commons Attribution 2.5 South Africa License.
see more at: http://creativecommons.org/licenses/by/2.5/za/
- new Blender(...) has been deprecated and will be removed in the next major version
- Added dir option
- Added beforeBlend callback option
- Added startIndex option
Version 1.0.2: 19 Aug 2007
- Updated DOM creation to use Builder.node in all instances
- Updated DOM traversal to use Element.up() for parent nodes
Version 1.0.1: 15 Aug 2007
- Added attributes option
- Now requires builder.js from Scriptaculous
- Now delays the start call by displayDuration
- Fixed a bug that started the blend with the 3rd image in the list
Version 1.0.0: 12 Aug 2007
- First version
  • source: blender.js
  • class: Blender
  • version: 1.1.0
  • author: Marc Heiligers marc@eternal.co.za http://www.eternal.co.za
Constructors
Widget.Blender.initialize(img, list, options)
The Blender class constructor.
parameters
string, img element img The id of or actual image element to be faded
array(string) list An array of paths (relative or absolute) of the images
object options? An object of options.
Widget.Blender.initialize.options(id, fadeDuration, displayDuration, autoSize, autoStart, noWrap, attributes, dir, beforeBlend, startIndex)
The default options object.
parameters
string id? The id used as queue scope. (default: img.id)
float fadeDuration? The time in seconds of the fade in/out. (default: 2.5)
float displayDuration? The time in seconds that the image is not faded out after being faded in. (default: 2.5)
bool autoSize? Set true if the image should be sized to it's container. Maintains aspect ratio. (default: false)
bool autoStart? If false the Blender will not start until Blender#start is called. (default: true)
bool noWrap? If false the Blender will not wrap the image in a div and use the image's parent container. (default: false)
object attributes? An associative array of attributes given to the image. (default: {})
string dir? The directory that all images reside in. Used as a prefix for the image src. (default: null)
function beforeBlend? A function that is called before the images are blended. 2 parameters are passed: 1. the image being faded out; 2. the image being faded in (default: null)
int startIndex? The index of the first new image to be shown. (default: 0)
Functions
Starts the fading if the autoStart option was set to false or after a call to stop.
Stops the fading and sets the opacity of the current image to 100%.
Objects
Blender
Generated by JsDoc Toolkit on Fri, 07 Dec 2007 06:02:26 GMT