How to disable the full-size image option when clicking on an image

Since version 4 of Confluence, when I add an image, it can always be clicked and it will pop-up in full-size. For certain image this is useful, but I have many images that I don t want to have this behavior (titles done as image instead of text or logos).

Is there an option to enable/disable this functionality for each image?

Thank you!

3 answers

6 votes

There are three ways to do this:

1. Through stylesheet "trick" where it changes the "point" to normal cursor when hovering over an image.

.confluence-embedded-image { 
  cursor: default !important; 
}

2. Add Custom HTML in Confluence Admin >> Look and Feel. This will disable all images to be enlarged when you click them (applies Globally).

<script type="text/javascript">
   
 AJS.toInit(function() {
 // unbind directly-embedded images
 AJS.$("img.confluence-embedded-image").unbind("click.fb");
 });
 </script>

3. Enable HTML Macro. Then insert the below html macro in a page where you wish to disable the full-size image option (applies only to particular pages that has the macro embedded).

<script type="text/javascript">
 
AJS.toInit(function() {
  // unbind directly-embedded images
  AJS.$("img.confluence-embedded-image").unbind("click.fb");
 
 // unbind the gallery macro
  AJS.$("a.gallery-link").unbind("click.fb");
 
 // unbind the attachments macro
 AJS.$(".attachments a.filename").unbind("click.fb");
});
</script>

Hope this helps.

Hi, thanks.

I just linked the image to a bogus anchor, so didn't create any anchor but still linke the image to #1 (for example). Maybe is not as professional, but gets the result.

What is the "click.fb" mean? Is the .fb something special with Confluence?

Thanks for the tip Javier! Since I don't have admin rights on company confluence, this was the only way I found that allows me to disable the image popup: [!http://link.to/image.png!|#bogusanchor]

Hi @Chung Park Chan ,

The snippet code you provide as the 3rd option does not work. Maybe it is outdated?

I'd like to get thumbnails displayed (full size) in a popup window instead of the fancybox popover. Is there some way to rebind these to popups instead of simply disabling them?

I did something a little different than the above solutions.

First I created a new page in my Space. On this page, I just attach images that will be added as an HTML Image to other pages in the space.

On a page where I just want a plain-old image, first I right-click on the URL of the image I want that is sitting on my "Images" page, then in the page I am editing, I paste-in the URL, set the correct image width and height, and viola! You just get an image - not clickable, no popup....just an image.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,100 views 17 14
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you