×
Namespaces

Variants
Actions

DrY Carousel

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Code ExampleArticle
Created: symbianyucca (16 May 2010)
Last edited: hamishwillee (05 Jul 2012)
DrY Carousel component is based on Guarana Button implementation, and its functionality thus is rather similar to the Guarana implementation.

Following code snipped shows how it can be used:

dojo.require("dry.Carousel");
 
function imageSelected(new_value,div_id){
console.log(div_id + " selected item: " + new_value);
}
 
imagesData1 = [{
image: "images/carousel01.jpg"
},{
image: "images/carousel02.jpg"
},{
image: "images/carousel03.jpg"
},{
image: "images/carousel04.jpg"
},{
image: "images/carousel05.jpg"
},{
image: "images/carousel02.jpg"
},{
image: "images/carousel01.jpg"
},{
image: "images/carousel05.jpg"
},{
image: "images/carousel02.jpg"
},{
image: "images/carousel01.jpg"
}];
 
var car1 = new dry.Carousel({
items: imagesData1,
selectedItem: 0,
selected: imageSelected,
itemheight: 83,
itemwidth: 83,
visibleItems: 3,
styleTweaker: styleTweaker},
'controlDiv1');

The constructor takes 2 items, where the second one is the name for the div where the Carousel is placed in. The first argument is a struct defining the Carousel properties and callback functions:

  • items: array of images to be used with the carousel,
  • selectedItem: initially selected image,
  • selected: callback called when image is selected,
  • itemheight: height for individual image item,
  • itemwidth: width for individual image item,
  • visibleItems: amount of visible items in the Carousel,
  • styleTweaker: styleTweaker for handling the themes.


Examples

Go to DrY Index

This page was last modified on 5 July 2012, at 06:45.
44 page views in the last 30 days.
×