<![CDATA[ Change image title on arrow click and slideshow - My Forums]]> https://forums.modx.com/thread/?thread=87049 <![CDATA[Re: Change image title on arrow click and slideshow]]> https://forums.modx.com/thread/87049/change-image-title-on-arrow-click-and-slideshow#dis-post-479610
I am using the external carousel but this should apply to the other versions.

First I added an id to the paragraph box for the description - as javascript cant track down a class. This is the label p element.
So under the first line mentioned below, in your jd.gallery.js file put the second line listed below. Please note that I put my title in the paragraph as the title h1 was used for the gallery name - so just swap it around to your liking.

this.carouselLabel = new Element('p').addClass('label').injectInside(carouselElement);
			this.carouselLabel.id = "label";


Then in the function nextItem: function() put:
document.getElementById('label').setHTML(this.galleryData[this.nextIter].title);


Same for the prevItem: function().

This will update the label title when clicking the arrows and also when the slideshow starts.

Finally you might want to show the image name when you first load the page, so put the code shown below at the end of the function called constructThumbnails:

document.getElementById('label').setHTML(this.galleryData[0].title);


Cheers!]]>
pagalo Oct 07, 2013, 12:07 AM https://forums.modx.com/thread/87049/change-image-title-on-arrow-click-and-slideshow#dis-post-479610
<![CDATA[Change image title on arrow click and slideshow]]> https://forums.modx.com/thread/87049/change-image-title-on-arrow-click-and-slideshow#dis-post-479606
I would love to have these extras:

1. show the initial title of the first image at the start with no mouse over.

2. change the title when clicking the next or previous arrows.

3. change the title when the slideshow kicks in.

Any ideas?]]>
pagalo Oct 06, 2013, 09:33 PM https://forums.modx.com/thread/87049/change-image-title-on-arrow-click-and-slideshow#dis-post-479606