bigger image opens in new window within an existing javascript.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jp

    bigger image opens in new window within an existing javascript.

    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
  • Vincent van Beveren

    #2
    Re: bigger image opens in new window within an existing javascript.

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

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

    <script language="JavaS cript">

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

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

    viewwin = window.open(img src,'viewwin', 'width=400,heig ht=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:[color=blue]
    > 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[/color]

    Comment

    Working...