Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Revision as of 03:45, 5 July 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

DrY Carousel

From 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:

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},

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.


Go to DrY Index

This page was last modified on 5 July 2012, at 03:45.
29 page views in the last 30 days.