Question

I found nice photo gallery with Carousel here.

This is very nicely done. I would like to have caption with html tags which is not working for current version.

I tried different thing but didn't work.

how can i make it work as below

<a href="#"><img src="image1.jpg" data-large="imagelarge.jpg" alt="image" data-description="<b>TITLE</b><br>DATE" /></a>

Any help is appreciated.

Was it helpful?

Solution

In the _showImage function find the line that says

if( title )
    $rgGallery.find('div.rg-caption').show().children('p').empty().text( title );

Replace the text function on the second line with html.

You could further make this functionality optional using another data attribute

var skip_escape_html = $thumb.data('skip_escape_html');

and then calling a function based on that

    $rgGallery.find('div.rg-caption').show().children('p').empty()[ skip_escape_html ? 'html' : 'text' ]( title )
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top