This is a test of sweet-text using Javascript.

<code-block>
<code-line><script src="example.js"><code-line>

var Webflow = Webflow || [];

Webflow.push(function() {

// When a lightbox is clicked

$('.w-lightbox').click(function() {

// Get the data-caption attribute from the lightbox

caption = $(this).data('caption');

// If caption is missing, do nothing

if(typeof caption == 'undefined' || caption == '') return;

// Remove the existing caption (if any)

$('.w-lightbox-caption').remove();

// Append the caption into the lightbox after a split second

setTimeout(function() {

$('.w-lightbox-figure').append('<figcaption class="w-lightbox-caption">'+caption+'</figcaption>');

}, 500);

});

}); // End ready function

</script>

<code-block>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.