UI. Ajax. Carousel

Gives the AJAX power to carousels.  An AJAX carousel :

  • Use AJAX to add new elements on the fly

Example

new UI.Ajax.Carousel("horizontal_carousel",
  {url: "get-more-elements", elementSize: 250});
Summary
Gives the AJAX power to carousels.
It also include of all carousel’s options
Required, it define the size of all elements
Required, it define the URL used by AJAX carousel to request new elements details
It also include of all carousel’s attributes
Size of each elements, it’s an integer
Index of the last loaded element
Flag to define if there’s still more elements to load
Define whether a request is processing or not
Callback to update carousel, usually used after request success
URL used to request additional elements
List of events fired by an AJAX carousel, it also include of all carousel’s custom events
Fired when the request has just started
Fired when the request has succeed
Constructor function, should not be called directly
Request the new elements details
Scrolls carousel from maximum deltaPixel
Update the carousel
Return elements size in pixel
Should be called if carousel size has been changed (usually called with a liquid layout)

Options

Notice

It also include of all carousel’s options

elementSize

Required, it define the size of all elements

url

Required, it define the URL used by AJAX carousel to request new elements details

Attributes

Notice

It also include of all carousel’s attributes

elementSize

Size of each elements, it’s an integer

endIndex

Index of the last loaded element

hasMore

Flag to define if there’s still more elements to load

requestRunning

Define whether a request is processing or not

updateHandler

Callback to update carousel, usually used after request success

url

URL used to request additional elements

Events

List of events fired by an AJAX carousel, it also include of all carousel’s custom events

request: started

Fired when the request has just started

request: ended

Fired when the request has succeed

Constructor

initialize

initialize: function($super,
element,
options)

Constructor function, should not be called directly

Parameters

elementDOM element
options(Hash) list of optional parameters

Returns

this

Actions

runRequest

runRequest: function(options)

Request the new elements details

Parameters

options(Hash) list of optional parameters

Returns

this

scroll

scroll: function($super,
deltaPixel)

Scrolls carousel from maximum deltaPixel

Parameters

deltaPixela float

Returns

this

update

update: function(transport,
json)

Update the carousel

Parameters

transportXMLHttpRequest object
jsonJSON object

Returns

this

Size and Position

computeElementSize

computeElementSize: function()

Return elements size in pixel

Returns

an integer value

updateSize

updateSize: function($super)

Should be called if carousel size has been changed (usually called with a liquid layout)

Returns

this

initialize: function($super,
element,
options)
Constructor function, should not be called directly
runRequest: function(options)
Request the new elements details
scroll: function($super,
deltaPixel)
Scrolls carousel from maximum deltaPixel
update: function(transport,
json)
Update the carousel
computeElementSize: function()
Return elements size in pixel
updateSize: function($super)
Should be called if carousel size has been changed (usually called with a liquid layout)