Results 1 to 8 of 8

Thread: Only a little thing, I'm sure ...

  1. #1
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Only a little thing, I'm sure ...

    Hello helpful faceless folk,

    All I want is this: when someone clicks a link to a picture on my main page, a new window opens to display the picture. Easy peasy. But then if they don't close the window and they click on another link on my main page, I want the new picture to be displayed in the same already open window, rather than another new one opening.

    Can someone help me here? I'm sure it can't be much.

    Cheers,
    Matt

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Easy enough. Give your pop up links a name variable:

    Code:
    window.open('mywin.htm','name','height=255,width=250, toolbar=no,directories=no,status=no,menubar=no, scrollbars=no,resizable=no');
    When you make the links... just make sure NAME is the same. That's it.

    Or if you are using JS to make the pop up:

    Code:
    TheNewWin = window.open('','name','height=255,width=250, line toolbar=no,directories=no,status=no,menubar=no, scrollbars=no,resizable=no');
    Same thing there though, just different pop up controls
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    popups might be blocked.

    <a href=... target="_blank">
    will give you a new window.

    The catch is that it needs a name attached to it, and I'm not sure how to do that. there are certainly complex ways in javascript.

    The above will work, but requires using a javascript popup script, and that doesn't seem like the best solution, though it would work, and most likely be ok with most popup blocker as it is user-initiated, not automaticaly loaded.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Of course the way around that is to put a "disclaimer" text on that page telling visitors they need popups/JS enabled to view the content they are after.

    I have my pop up blocker on strict, and I have it turned off about the warning, so I never even know about the pop ups.. it's nice to see those little disclaimers so I can go and add the site to the white list.



    <edit> Yes I know that wont work all the time either, but then at least you can say "I told you so!" </edit>
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Really, in the end, just don't worry about it. It's not complex to close a window if you have too many.
    If there is a specific reason you need this, then look into complex javascript and/or javascript popups, but it will be easier for you (and your viewers) if you DON'T put anything rather than putting something incredibly complex and likely fairly incompatible. (Most javascript isn't the same in all browsers/systems)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks chaps, I'll go the simple BLiZZaRD way if only I can get rid of the automatic border in the pop-up window ????


    I tried simply sticking leftMargin=0 topMargin=0 marginwidth="0" marginheight="0" in the brackets, but to no avail yet.

  7. #7
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    try "border=none" or "border=0"

    Not sure though... I need a nap
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  8. #8
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Instead of having to make a page for each pic, just make the link the img src:

    Code:
    <a href="whatever.jpg" target="_blank">
    - Mike

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
  •