SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast Stewarty-Boy's Avatar
    Join Date
    Dec 2003
    Location
    Dundee, Scotland.
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Controlling the size of popups ???

    Hi Folks.

    I've a wee problem getting a popup to be the size of the image I want it to contain. I've already searched the Forum and found one such post from about 100 years ago which I have tried to use without success. The deal is this:

    1 - I have an image I would like to enlarge but would like the person viewing my page to still be able to see the original page which was being viewed. Therefore a popup is the obvious solution.

    2 - The link to click on to initiate the popup is a smaller version of the image which is about to be viewed.

    Here's The code I tried. This code, incidentally, doesn't creat a popup. Nor does it resize it to the size I want it. It merely opens up another full-sized html page which I already have the image on.
    <div class="image">

    <a href="http://www.gta-jutecity.pwp.blueyonder.co.uk/jute-city/client-screenshot.html" onClick="window.open('http://www.gta-jutecity.pwp.blueyonder.co.uk/jute-city/client-screenshot.html',null,"height=335,width=770");return false; "target="newWin"> <img src="/images/jute-city/tutorial-screenshots/vc-client-03.jpg" alt="VC Client 0.3" width="300" height="150" /></a>

    </div>
    Does anyone know what I can do to get this to work? I would be eternally grateful. Here's a link to the page the image is on. The image is in the centre of the page approximately half way down: http://www.gta-jutecity.pwp.blueyond...gta-vc-03.html


    Regards.

    Stewart-boy.

  2. #2
    SitePoint Member
    Join Date
    Dec 2002
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    give this a whirl. There were just a couple minor errors.
    <a href="http://www.gta-jutecity.pwp.blueyond...creenshot.html" onClick="window.open('http://www.gta-jutecity.pwp.blueyonder.co.uk/jute-city/client-screenshot.html',null,'height=335,width=770');return false;"> <img src="/images/jute-city/tutorial-screenshots/vc-client-03.jpg" alt="VC Client 0.3" width="300" height="150" /></a>

  3. #3
    SitePoint Enthusiast Stewarty-Boy's Avatar
    Join Date
    Dec 2003
    Location
    Dundee, Scotland.
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Nice.

    Hi cv765.

    Thanks for that. It works perfectly. You don't happen to know how I could make a link on the popup close it down do you?


    Stewary-boy.

  4. #4
    SitePoint Member
    Join Date
    Dec 2002
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <a href="#" onClick="window.close();">close window</a>
    that should work for you.

  5. #5
    SitePoint Enthusiast Stewarty-Boy's Avatar
    Join Date
    Dec 2003
    Location
    Dundee, Scotland.
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up I just found this...

    Hi cv765.

    I managed to find this:<a class="link1" href="javascript:top.window.close();">Close Window</a> and tried it out just before I came to the forum to check on my thread and it works. However, should I use the method you're recommending as I'm afraid I don't know squat about JavaScript. What do you think?

    In the mean time thanks for helping me out cv765.


    Stewarty-boy.<edit> I decided to just go with your version cv765 as the one I found looked like I was putting more code in than i needed.

    Thanks again. </end edit>
    Last edited by Stewarty-Boy; Jan 3, 2004 at 11:36.


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
  •