Alt Tags as Captions for CMS Multi-Images

site profile thumbnail
An easy solution to render multi-images alts tags (edited in cms) into captions for the dynamic list of images. Some instructions: Go to the template page and copy the custom code (script) from the page settings. Two classes are needed: The image class (e.g. "retro_img") and a class for the captions (e.g. "caption"). The captions will be automatically put under the image as a paragraph. To control the look of the captions, create a paragraph element, add a class "captions", style it and then delete the paragraph (only the class must remain in the css). Done, the captions should appear under the image. I'm sure you can bring this very basic example even further. Script found in stackoverflow created by user "SuperDJ": https://stackoverflow.com/questions/51964433/display-image-alt-text-using-vanilla-javascript Happy cloning.

More sites by Patrick Urwyler

See profile