469,319 Members | 2,291 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,319 developers. It's quick & easy.

bigger image opens in new window within an existing javascript.

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
Jul 23 '05 #1
1 2065
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

jp wrote:
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


Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Randell D. | last post: by
3 posts views Thread by Becky Carter Hickman-Jones | last post: by
1 post views Thread by Aussie Rules | last post: by
15 posts views Thread by mistral | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.