After instantiating Chocolat you can get access to its api using :
const { api } = Chocolat(document.querySelectorAll('#example3 .chocolat-image'), {
container: document.querySelector('#container2'),
imageSize: 'contain',
firstImageIndex: 0,
loop: true,
allowZoom: false
});
Then simply call open()
api method to open the first image:
// Opens the first image
api.open();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…