Quantcast
Channel: Active questions tagged tabs - Stack Overflow
Viewing all articles
Browse latest Browse all 587

Using javascript to open image and text in new tab

$
0
0

I have several figures that are to big for my HTML page.

So the action I would like to have is, a thumbnail image in my HTML that when the user clicks, a new tab is opened with a image, figure title and text (e.g. something like caption="This is my caption").

However, I do not want to have a bunch of new HTML pages with all my figures and I do not want to have a bunch of small and full-sized images. Instead I would like something "cleaner"

My code below has the one figure (the original size) but displays the image as a thumbnail and when you click, it opens the figure in a new tab.

Is there a simple way to add my caption text (and allow me to reuse it for all my figures and captions)?

<a href='#' onClick=window.open('js/Figures/BI_Figure1.png','_blank');><img src='js/Figures/BI_Figure1.png' alt=&#34;thumb&#34; width=100px;height=100px/></a>

Viewing all articles
Browse latest Browse all 587

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>