This is a message.

Add and remove items from scrollable

This demo shows you how to add and remove scrollable items. Notice how the scrollable navigator grows and the next/prev buttons behave correctly.

standalone demo

You can add items to a circular scrollable as well. This page's source code is identical to the minimal setup except that the add and remove buttons were added.

A new item

The item we are adding is the child element of DIV#newItem:

<div id="newItem" style="display:none">
<div class="added">
<!-- scrollable items can have anything and any amount -->
<img src="" />
<img src="" />
<h3>New Item</h3>


addItem function

Every added item is a clone of a single DIV. We use addItem method from the Scrollable API to add new items. It takes one argument which is the new item.

// initialize scrollable together with the navigator plugin


Photo credits »