Tridi v2 — Upgrade to version 2.x

Looking for older version? Read Tridi v1 documentation or how to upgrade to version 2.x

In version 2.0, Tridi exports a create factory function accepting options object instead of a class. Apart from that, the whole API remains compatible with 1.x version.

Basic example - version 1.x:

// we initialize a class and invoke load() function to render the viewer

new Tridi({
  element: '#tridi-basic',
  location: './path/to/images',
  format: 'jpg',
  count: 36,
}).load();

Basic example - version 2.x:

// call create() with options object to set up the viewer

const tridiInstance = Tridi.create({
  element: '#tridi-basic',
  location: './path/to/images',
  format: 'jpg',
  count: 36,
});

// render the viewer
tridiInstance.load();

« Back to main page