Close

Results 1 to 11 of 11
  1. #1
    DF PiMP EUPHORiA's Avatar
    Join Date
    Dec 2000
    Location
    Manchester UK
    Posts
    363
    Thanks
    0
    Thanked:        1
    Karma Level
    209

    Default Open Links in Popup window?

    I know there is a way to open a link in a seperate popup window. Is it possible to open a link to an image in a popup window (centered) which is the EXACT same size of the image itself? if not is there a way to open a popup window from a link to a image centered and at a customizable size?

    Cheers

  2. #2
    DF PiMP graham.edmon's Avatar
    Join Date
    May 2001
    Location
    Edinburgh
    Posts
    263
    Thanks
    0
    Thanked:        0
    Karma Level
    200

    Default

    PHP Code:
    <html>
    <
    head>
    <
    script language="JavaScript">
    <!--
    function 
    windowOpen(windowname,xsize,ysize) {
            var 
    thiswinopen('',windowname,'width='+xsize+',height='+ysize+',resizable=yes,scrollbars=yes');
            if (
    thiswin.focusthiswin.focus();
    }
    //-->
    </script>
    </head>
    </body>
    <a HREF="mypage.html" TARGET="picturepage" onClick="windowOpen('picturepage',640,480)">HTML Picture</a>

    or

    <a HREF="mypicture.jpg" TARGET="picturepage" onClick="windowOpen('picturepage',640,480)">Actual Picture</a>
    </body>
    </html> 
    The above code works in the way you describe, the first example HTML Picture, is the correct way of doing it. So basically the popup has HTML code in it that displays your picture.

    The second example, Actual Picture, will work on some peoples browsers and not others. You make an assumption on peoples IE/Computer configuration when doing this.

    Hope this helps

  3. #3
    DF PiMP EUPHORiA's Avatar
    Join Date
    Dec 2000
    Location
    Manchester UK
    Posts
    363
    Thanks
    0
    Thanked:        1
    Karma Level
    209

    Default

    Cheers m8

  4. #4
    DF PiMP EUPHORiA's Avatar
    Join Date
    Dec 2000
    Location
    Manchester UK
    Posts
    363
    Thanks
    0
    Thanked:        1
    Karma Level
    209

    Default

    i tried to use it and it opens up another another window (blank) along with the window its meant to load up as well.. any ideas?

  5. #5
    DF PiMP graham.edmon's Avatar
    Join Date
    May 2001
    Location
    Edinburgh
    Posts
    263
    Thanks
    0
    Thanked:        0
    Karma Level
    200

    Default

    &lt;a HREF="mypage.html" TARGET="picturepage " onClick="windowOpen('picturepage ',640,480)"&gt;


    make sure that the TARGET tag and the first parameter of the call in the onClick are the same, including the case. If they are, then send me a URL or the code, and I will take a gander...

  6. #6
    DF PiMP EUPHORiA's Avatar
    Join Date
    Dec 2000
    Location
    Manchester UK
    Posts
    363
    Thanks
    0
    Thanked:        1
    Karma Level
    209

    Default

    OK well atm i am using

    PHP Code:
    <script language="JavaScript">
    <!--
    function 
    windowOpen(windowname,xsize,ysize) {
            var 
    thiswinopen('',windowname,'width='+xsize+',height='+ysize+',resizable=yes,scrollbars=yes');
            if (
    thiswin.focusthiswin.focus(); }
    //-->
    </script> 
    within the head

    and this as a link

    PHP Code:
    <a HREF="gallery/carol/1/pictures.htm" TARGET="picturepage " onClick="windowOpen('picturepage ',640,480)">1</a
    Last edited by EUPHORiA; 26th August 2002 at 11:32 AM.

  7. #7
    DF PiMP graham.edmon's Avatar
    Join Date
    May 2001
    Location
    Edinburgh
    Posts
    263
    Thanks
    0
    Thanked:        0
    Karma Level
    200

    Default

    just tried it myself, and it works fine.

    PHP Code:
    <html>
    <
    head>
    <
    script language="JavaScript">
    <!--
    function 
    windowOpen(windowname,xsize,ysize) {
            var 
    thiswinopen('',windowname,'width='+xsize+',height='+ysize+',resizable=yes,scrollbars=yes');
            if (
    thiswin.focusthiswin.focus(); }
    //-->
    </script>
    </head>
    <body>
        <a HREF="pictures.htm" TARGET="picturepage" onClick="windowOpen('picturepage',640,480)">1</a>
    </body>
    </html> 
    loaded up the pictures.htm file up fine in a sized new window.. which browser are you trying this in? are you sure there is nothing else calling a windowOpen function to open up another window?

  8. #8
    DF PiMP EUPHORiA's Avatar
    Join Date
    Dec 2000
    Location
    Manchester UK
    Posts
    363
    Thanks
    0
    Thanked:        1
    Karma Level
    209

    Default

    using IE6 and i am 100% sure there is nothing else called open window

  9. #9
    DF PiMP Marcus Berry's Avatar
    Join Date
    Oct 2002
    Location
    Leamington Spa
    Posts
    334
    Thanks
    0
    Thanked:        0
    Karma Level
    205

    Default

    I'm also trying to do something similar and using the above code works fine for me... Is it possible rather than have the user click some text (HTML picture in the above) you could have them click on a graphic?

  10. #10
    DF PiMP graham.edmon's Avatar
    Join Date
    May 2001
    Location
    Edinburgh
    Posts
    263
    Thanks
    0
    Thanked:        0
    Karma Level
    200

    Default

    as above but....


    PHP Code:

    </head>
    <
    body>
        <
    a HREF="pictures.htm" TARGET="picturepage" onClick="windowOpen('picturepage',640,480)"><img src="mypic.jpg" border="0" /></a>
    </
    body>
    </
    html

  11. #11
    DF PiMP Marcus Berry's Avatar
    Join Date
    Oct 2002
    Location
    Leamington Spa
    Posts
    334
    Thanks
    0
    Thanked:        0
    Karma Level
    205

    Default

    Originally posted by graham.edmon
    as above but....


    PHP Code:

    </head>
    <
    body>
        <
    a HREF="pictures.htm" TARGET="picturepage" onClick="windowOpen('picturepage',640,480)"><img src="mypic.jpg" border="0" /></a>
    </
    body>
    </
    html
    Thanks Graham - will give that a try this evening....

Similar Threads

  1. 'Open in new window' probs
    By Gel in forum PC Problems
    Replies: 3
    Last Post: 8th October 2006, 02:01 PM
  2. 'Open in New Window' problem
    By UkPapaSmurf in forum PC Problems
    Replies: 11
    Last Post: 28th January 2006, 12:45 PM
  3. Open window using Java
    By big man in forum Website Coding & Graphics
    Replies: 4
    Last Post: 14th April 2003, 12:56 PM
  4. Explorer window closes when open new window
    By zapiy in forum PC Problems
    Replies: 1
    Last Post: 28th March 2003, 01:39 AM
  5. Replies: 20
    Last Post: 10th December 2002, 09:44 PM

Social Networking Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •