471,887 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

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 2138
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
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.