×
Namespaces

Variants
Actions
(Difference between revisions)

Carousel

From Nokia Developer Wiki
Jump to: navigation, search
Forum Nokia KB (Talk | contribs)
m (1 revision)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Add ArticleMetaData)
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{ArticleMetaData <!-- v1.2 -->
 +
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Qt SDK 1.1.4]) -->
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20091106
 +
|author= [[User:Kbwiki]]
 +
}}
 +
[[Category:Guarana UI]]
 
=Inheritance=
 
=Inheritance=
  
<code>[[Widget | Nokia.Widget]]
+
<code>
   
+
Nokia.Carousel
|- Nokia.Carousel</code>
+
    |- Nokia.Widget
 +
        |- Nokia.Class (basic class)
 +
</code>
  
 
=1 - Description=
 
=1 - Description=
Line 23: Line 47:
 
<pre>
 
<pre>
 
<!-- Themeroller CSS -->
 
<!-- Themeroller CSS -->
<link rel="stylesheet" href="/themes/themeroller/default-theme/THEMEROLLER.css" type="text/css" media="screen">
+
<link rel="stylesheet" href="themes/themeroller/<theme>/Themeroller.css" type="text/css" media="screen">
<!-- Nokia WRT Framework Base CSS -->
+
<link rel="stylesheet" href="/themes/nokia/base/JS4WRT.css" type="text/css" media="screen">
+
 
<!-- Specific Theme/Resolution CSS -->
 
<!-- Specific Theme/Resolution CSS -->
 
<link rel="stylesheet" href="/themes/nokia/ext-theme/<theme>/<resolution>/custom.css" type="text/css" media="screen">
 
<link rel="stylesheet" href="/themes/nokia/ext-theme/<theme>/<resolution>/custom.css" type="text/css" media="screen">
</pre>
+
</pre>  
 
   
 
   
 
==3.2 Javascript==  
 
==3.2 Javascript==  
Line 34: Line 56:
 
<pre>
 
<pre>
 
<!-- jQuery file -->
 
<!-- jQuery file -->
<script src="/lib/jquery/JQUERY.js" type="text/javascript" charset="utf-8"></script>
+
<script src="/lib/jquery/jQuery.js" type="text/javascript" charset="utf-8"></script>
<!-- JS4WRT file -->
+
<!-- Guarana file -->
<script src="/lib/JS4WRT.js" type="text/javascript" charset="utf-8"></script>
+
<script src="/lib/Guarana.js" type="text/javascript" charset="utf-8"></script>
</pre>
+
</pre>  
 
   
 
   
 
=4 - Functional Specifications/Requirements=
 
=4 - Functional Specifications/Requirements=
Line 61: Line 83:
 
*delay: int  
 
*delay: int  
 
**Defines the delay time used in the transition effect.  
 
**Defines the delay time used in the transition effect.  
*select: function
 
**TO DO
 
 
   
 
   
  

Latest revision as of 13:35, 30 July 2012

Article Metadata
Article
Created: User:Kbwiki (06 Nov 2009)
Last edited: hamishwillee (30 Jul 2012)

Contents

[edit] Inheritance

Nokia.Carousel
|- Nokia.Widget
|- Nokia.Class (basic class)

[edit] 1 - Description

The Carousel component's icon is fixed in horizontal position, and each element within it is a link. If the carousel contains so many elements that they do not fit on the screen, an arrow sign to indicate this must be shown over the first or last element.


[edit] 2 - Visual Design

Carousel01.png

[edit] 3 - Component Dependencies

[edit] 3.1 CSS

<!-- Themeroller CSS -->
<link rel="stylesheet" href="themes/themeroller/<theme>/Themeroller.css" type="text/css" media="screen">
<!-- Specific Theme/Resolution CSS -->
<link rel="stylesheet" href="/themes/nokia/ext-theme/<theme>/<resolution>/custom.css" type="text/css" media="screen">

[edit] 3.2 Javascript

<!-- jQuery file -->
<script src="/lib/jquery/jQuery.js" type="text/javascript" charset="utf-8"></script>
<!-- Guarana file -->
<script src="/lib/Guarana.js" type="text/javascript" charset="utf-8"></script>

[edit] 4 - Functional Specifications/Requirements

[edit] 4.1 - Options

  • element: 'selector'
    • jQuery selector or the DOM reference to become the container of the component.
  • items: Object[]
    • Defines the list of elements in the component.
  • visibleItems: int
    • Defines the number of visible elements.
  • backgroundClass: string
    • Defines the CSS class of the component background.
  • options.itemDimensions.width: int
    • Defines the component width.
  • options.itemDimensions.height
    • Defines the component height.
  • applyTransition: boolean
    • Defines whether a transition effect will be applied in component interaction.
  • delay: int
    • Defines the delay time used in the transition effect.


[edit] 4.2 - Events - Callbacks

  • create: function()
    • Scope: [this.element]
  • prev: function(event)
    • Scope: [this.element]
  • next: function(event)
    • Scope: [this.element]


[edit] 4.3 - Methods

  • roll: function(increment, time)
    • Applies roll in the component. The roll direction is defined by increment. The delay applied in animation is defined by time.
    • return [void]

[edit] 4.4 - Default options

  • items: '> li',
  • backgroundClass: 'ui-state-default',
  • visibleItems: 5,
  • applyTransition: false,
  • delay: 1000,
  • itemDimensions: { height: 75, width: 75}
  • select: function(event, item) {}

[edit] 5 - Component Demo

[edit] 5.1 HTML

<ul id="carousel1">
     <li><img src="images/icon1.png"/></li>
     <li><img src="images/icon2.png"/></li>
     <li><img src="images/icon3.png"/></li>
     <li><img src="images/icon4.png"/></li>
     <li><img src="images/icon5.png"/></li>
     <li><img src="images/icon6.png"/></li>
     <li><img src="images/icon7.png"/></li>
     <li><img src="images/icon8.png"/></li>
     <li><img src="images/icon9.png"/></li>
     <li><img src="images/icon10.png"/></li>
</ul>

[edit] 5.2 Javascript

window.carousel1 = new Nokia.Carousel({
     element: '#carousel1',
     visibleItems: 4,
     width: 400,
     delay: 150,
     create: function() {
          //alert("Carousel: Create");
     },
     select: function(event, item) {
          //alert("Carousel: Select", event);
     },
     next: function(event) {
          //alert("Carousel: Next", event);
     },
     prev: function(event) {
          //alert("Carousel: Prev", event);
     }
});

[edit] 6 - Nokia WRT Browser Compatibility

▴   S60 3.1 S60 3.2 S60 5.0
Carousel NO YES  YES 
This page was last modified on 30 July 2012, at 13:35.
81 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×