Skip to main content
100%

Make the figures click-able in your RMarkdown=>HTML reports.

✓ Published0🌍 Public
DDougManuel
Last edited Sep 28, 2016
Created on Dec 6, 2018

This example demonstrates how to make figures clickable in an RMarkdown-generated HTML report, allowing readers to open images in full resolution in a new browser tab. It shows the integration of JavaScript with RMarkdown's HTML output to enhance interactivity. The code uses jQuery to select all images wrapped in figure elements, then wraps each image in an anchor tag that references the image source as the link URL. The script sets the link's title attribute to the image's alt text and adds `target="_blank"` to open the link in a new tab. The implementation relies on jQuery's `wrap` function and attribute manipulation methods.

AI-generated description

Similar vizzes