H there,
I want to delete the slide from the slideshow.
In the above slideshow ($w("#slideshow1"), we have 7 slides. Can we show() or Hide() the slides based on our requirements? Like, if we want to delete Slide 4 and Slide 7 through Velo code then how can we do it.
Do we have this option in Velo?
Thanks in Advance!
Thank you so much for your response. I will look into this.
You cannot delete slides with Velo code.
However, if you disable the auto slide switch, and handle the slide change by code only, you can skip any slide you want (You can either change slide on button click of every x second -- using code).
For example, let say you add next and previous buttons to the page (yu can design them as arrows if you wish).
For example, let's say you want to skip slides #4 and #6 (starting from zero. It's the slide index, not the slide name).
let slideIndices = []; $w.onReady(() => { let toSkip = [4,6]; slideIndices= $w('#slideshow1').slides.map((_,i) => i).filter(e => !toSkip.includes(e)); let i = 0;//assuming you want to begin with the first slide, otherwise change to the slide show to first slide you want to show. toggleButtons(i); $w('#nextButton, #prevButton').onClick(event => { const newInxChange = event.target.id === 'nextButton' ? 1 : -1; $w('#slideshow1').changeSlide(i + newInxChange ) .then(() => { i += newInxChange; toggleButtons(i); }) }) }) function toggleButtons(i){ i === slideIndices[slideIndices.length -1] ? $w('#nextButton').disable() : $w('#nextButton').enable(); i === slideIndices[0] ? $w('#prevButton').disable() : $w('#prevButton').enable(); }