API

API

The API allows Strip to be used with just Javascript, as an alternative to using the strip class on links. The most common use of the API is opening multiple items from a single link.

Strip.show()

A single item can be shown by giving Strip.show() a url:

Strip.show('image.jpg');
Show image

Add a caption by using an object instead:

Strip.show({
  url: "image.jpg",
  caption: "Caption for this image"
});
Caption

This object also accepts options to customize Strip:

Strip.show({
  url: 'http://vimeo.com/32071937',
  options: {
    side: 'top'
  }
});
Options

Groups

Groups can be shown by giving Strip.show() an array with multiple items:

// use urls
Strip.show(['image1.jpg', 'image2.jpg']);

// or objects
Strip.show([
  { url: 'image1.jpg', caption: 'Caption for this image' },
  { url: 'image2.jpg', caption: 'Another caption' }
]);
Group

Options for the entire group can be set using the second argument:

Strip.show(['image1.jpg', 'image2.jpg'], {
  loop: false,
  maxWidth: 500
});
Group Options

Open Strip at a specific position by setting a number as the last argument:

Strip.show(['image1.jpg', 'image2.jpg'], 2);
Position

Links

Links that use the strip class can also be opened by passing Strip.show() an element:

Strip.show($('#elementid')[0]);

Strip.hide()

Close Strip at any time by calling Strip.hide():

Strip.hide();

Strip.disable()

Disables Strip. When disabled, links using the strip class will no longer open Strip but work as regular links. Calls to Strip.show() will use a fallback to make them behave like regular links.

Strip.disable();

Use Strip.fallback(false) should you need to disable this fallback as well:

Strip.fallback(false).disable();

Strip.enable()

Enable Strip if it was previously disabled.

Strip.enable();

Strip.fallback()

When Strip is disabled it will fallback to making Strip.show() calls open as regular links. By disabling this fallback API calls will do nothing at all.

Strip.fallback(false);

Strip.setDefaultSkin()

Sets the name of the default skin, this skin will be used when no skin option is provided.

Strip.setDefaultSkin('custom');