I am currently trying to change my image source when clicking on the image, until the last image is shown.
In the page template, I defined these variables:
$mn = 0;
$first = $page->images()->nth($mn);
(I somehow tried to increase the $mn variable on click, but didn’t succeed)
this is the image I try to change:
<image id="first" src="<?= $first ->url() ?>"onclick="change_image()">
And I am using this script.
So this only helps me change the image to next listed one (of course), but at the moment I have no idea how to go further.