
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2020 11:10 PM
I'm inserting a image as a thumbnail in an article and want the image to show up in original size when it is double clicked.
I see some images in ServiceNow educational courses that'll expand when I click on it.
Currently, if I just insert an image as a thumbnail, it won't expand on double-click. Would appreciate if someone would show me how to expand the image on double click.
Solved! Go to Solution.
- Labels:
-
Knowledge Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2020 12:16 AM
in source code you will apply something like below
Screenshot :
<p>Scrolling text</p>
<p> </p>
<div class="imageContainer"><img src="setValue%20in%20ui%20page.pngx" width="700" height="650" /></div>
<style>
.imageContainer > img:hover {
width: 500px;
height: 200px;
}
</style>
<p> </p>
<p> </p>
Note: "setValue%20in%20ui%20page.pngx" : this would your image
make the changes in style based on your need.
if my answer helped you , kindly mark it as correct and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2020 07:02 AM
Hello,
If you use any CSS or Java script you will also have to update our HTML sanitizer to allow whatever coding to be used.
Out of the box I believe the <detail> is the only html feature that will let you do this (and you can use it for either images or text.
Start by looking at the HTML Code of your article:
You will then need to locate your image, this will look something like this:
You will then need to REPLACE the image string with a different code, here is an example:
<details>
<summary>Click to expand picture<br><img src="/sys_attachment.do?sys_id=32d17067dbb74c18469089584b96193b" width="72" height="96" /></summary>
<p><img src="/sys_attachment.do?sys_id=32d17067dbb74c18469089584b96193b" /></p>
</details>
Click to expand picture
Here is a more detailed breakdown:
Basically your code will be:
<details>
<summary>
Text or image of your summary
</summary>
Text of image you get to see when you click on the summary
</details>
Hope this helps
Lorenzo
PS: this code doesn't appear to work on the Community forum, so when you click the image above nothing will happen, but do try it on your instance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2020 04:11 AM
Thanks for your suggestion. When I click on the image in the community forum (i.e. here), I do get expanded image. However, before I expland, the enlarged image is also appearing after the thumbnail.
I tried it in Knowledge base article in my Orlando release, I'm getting "details" at the end of the article. If I click on the details link, expanded image do appear but then I can only have one set of image per article instead of being able to expand each image individually. It seems like ServiceNow is parsing the html source and separating the content in summary and in details.
Sorry, using <details> and <summary> in my Orlando instance doesn't work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2020 08:35 AM
Hi Hozawa,
I've noticed that too, the forum must be setup differently compared to the SN KB.
Have you tried something like this to handle multiple images in a single article:
<details>
<summary>
Thumbnail 1
</summary>
Full size image 1
</details>
<details>
<summary>
Thumbnail 2
</summary>
Full size image 2
</details>
For me this works.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2020 09:06 PM
Sorry, your solution doesn't work. It seems I can use css in knowledge articles but I've found I'm not able to use event such as :focus.