Nicole

Question to Marketing Shop

Discussion created by Nicole on Jul 1, 2019
Latest reply on Jul 18, 2019 by eiben

Hello,

 

I'm trying to establish a marketing shop and I have used your instruction: Link to Instruction 

But it doesn't work to configure the picture field with the button to show next image.

 

What I'm doing wrong?

 

List Setting:

 

DispForm

Image1: Visible =true

Image2: Visible =false

Image3: Visible =false

 

 

Code:

var buttonContainer = jQuery('#nextImage').closest('.ard-group');
var container = buttonContainer.closest('.ard-group-body');
var images = container.children('.ard-group');
for(var i=0; i<images.length; i++){
jQuery(images[i]).hide();
}
images = jQuery.map(images, function(element){
return jQuery(element).find('img').length ? element : null;
});
if( typeof window.imageId == 'undefined'){
window.imageId = 1;
} else {
window.imageId++;
}
var imageToShow = images[window.imageId % images.length];
jQuery(imageToShow).show();
buttonContainer.show();

 

Result. 

 

I don't see the next image after clicking on this button.

 

Can you please help me?

 

Kind regards

Nicole

Outcomes