Open image in new tab
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 316
- Joined: Wed Jun 17, 2015 10:19 am
Open image in new tab
Post by ann.jensen »
Hi,
I have a large image displayed in one of my webhelp transformation topics. I would like to make this image clickable and open it in a new browser e.g.
Is there a hook that would let me do this?
Thanks in advance,
Ann
I have a large image displayed in one of my webhelp transformation topics. I would like to make this image clickable and open it in a new browser e.g.
Code: Select all
<a target="_blank" href="image.png">
<img class="image" src="image.png">
</a>
Thanks in advance,
Ann
-
- Posts: 222
- Joined: Tue Jul 01, 2014 11:48 am
Re: Open image in new tab
Post by bogdan_cercelaru »
Hello,
You could do this using a custom JavaScript file containing the following code:
This makes any image clickable. When you click an image, a new browser window containing the image is opened. To restrict this behavior only to some specific images, you could use the outputclass attribute in your DITA topic and then use this outputclass in your custom JavaScript.
Regards,
Bogdan
You could do this using a custom JavaScript file containing the following code:
Code: Select all
$(document).ready(function(){
$('img.image').click(function(){
window.open($(this)[0].src, '_blank')
});
});
Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 316
- Joined: Wed Jun 17, 2015 10:19 am
Re: Open image in new tab
Post by ann.jensen »
Hi,
I realised since that I could do what I wanted using xref e.g.
I had never xref'ed on an image before 
Regards,
Ann
I realised since that I could do what I wanted using xref e.g.
Code: Select all
<xref format="png" scope="external" href="add_tt_pflow.png"
><image href="add_tt_pflow.png" scalefit="yes"/></xref>

Regards,
Ann
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service