# Enlarge Thumbnail Images

> Please note that this is now available as a plugin for easier installation. While you can use this document as a reference, the recommended method to add…

Source: https://tadabase.com/docs/snippets/enlarge-thumbnail-images  
Status: Not yet re-checked. Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

> **Warning:** Please note that this is now available as a plugin for easier installation. While you can use this document as a reference, the recommended method to add this functionality is through the plugin installation wizard. Learn more about plugins [here](https://tadabase.com/docs).

**Instead of opening an attachment field as full-size within a new tab, here is a way to stay on the same page and enlarge the image.**

![Screenshot for “Enlarge Thumbnail Images”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/Sz42022-08-23_21-34-36.png)

**First, we will need to navigate to the page within the builder and add an HTML component.**

![Screenshot for “Enlarge Thumbnail Images”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/2022-08-23_21-43-36.png)

**Next, you will Hover over the Information Icon to find the Component ID of the HTML component to use within your code.**

![Screenshot for “Enlarge Thumbnail Images”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/lqI2022-08-23_21-47-44.png)

**Next, copy and paste the following code into your page's JavaScript tab.**

```
displayComponent = "component_X";
jQuery('body').on('click', '.image-col a, .image-col img', function(e) {
    e.preventDefault();
    if ($(this).is("img")) {
        url = $(this).attr("src")
    } else {
        url = $(this).attr("href")
    }

    $html = "<div class='relative'><img src='" + url + "' class='img-responsive'><button type='button' style='position: absolute; top: 0;right: 0;' class='btn btn-danger btn-sm btn-hide-img'><i class='fa fa-times-circle' aria-hidden='true'></i></button>";
    $('[data-obj-id="' + displayComponent.replace("component_", "") + '"]').html($html);
});

jQuery('body').on('click', '.btn-hide-img', function(e) {
    e.preventDefault();
    $(this).parent().remove();
})
```

**To finish, remove the "X" from the code and replace it with your component number.**

![Screenshot for “Enlarge Thumbnail Images”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/2022-08-23_21-52-02.png)

**Original Community Post:**

[https://community.tadabase.io/t/showing-an-image-on-the-side-of-the-same-page-after-click-the-thumbnail/2287/6](https://community.tadabase.io/t/showing-an-image-on-the-side-of-the-same-page-after-click-the-thumbnail/2287/6)
