bigger image opens in new window within an existing javascript.

J

jp

bigger image opens in new window within an existing javascript.

I am working within a existing javascript.
see www.art4companies.nl and press kunstenaars than press any name to
see what I mean.

After clicking on the thumbnails it shows a bigger picture. I would
like to add the function, when clicked on the bigger image it will
open a new window showing the picture in a bigger size.

Thank in advance!!!

yours sincerely,

jp
 
V

Vincent van Beveren

You'll need to open a new window, with the window.open() function.

<IMG SRC="smaller image.jpg" onClick="view();">

<script language="JavaScript">

function view() {
imgsrc = '... address of current image to display ...';

// for example:
// imgsrc = 'big/pic'+id1+'.jpg';

viewwin = window.open(imgsrc,'viewwin', 'width=400,height=300');
viewwin.focus(); // just in case it was already open
}
</script>

You'll need to think of a way to get the right source for an image. Also
window.open has more parameters. I suggest you look at a JavaScript
tutorial for how to open new windows.

good luck,
Vincent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top