Opening a image in a new window

Discussion in 'HTML' started by Ria Van Heerden, May 13, 2004.

  1. Hi

    I have small thumbnail pics on my site - I want the client to click on them
    and then a new window will open without the toolbar and menu and the other
    stuff - displaying just the enlarged image. Can somebody help me to do this
    I just cant seem to get it right

    Kind Regards
    Ria
    Ria Van Heerden, May 13, 2004
    #1
    1. Advertising

  2. Ria Van Heerden

    SpaceGirl Guest

    "Ria Van Heerden" <> wrote in message
    news:...
    > Hi
    >
    > I have small thumbnail pics on my site - I want the client to click on

    them
    > and then a new window will open without the toolbar and menu and the other
    > stuff - displaying just the enlarged image. Can somebody help me to do

    this
    > I just cant seem to get it right
    >
    > Kind Regards
    > Ria



    You should be warned before going down this route, a *lot* of browsers block
    popups like this... A good percentage of people visiting the site, upon
    clicking the link will see nothing. Popup windows without toolbars requires
    scripting;

    <script language="javascript" type="text/javascript">
    function popUp(popupURL){
    var myPopup =
    window.open(popupURL,"photo",'toolbar=0,location=0,directories=0,status=0,me
    nubar=0,resizable=yes,scrollbars=yes,width=550, height=550');
    photo.focus();
    }
    </script>

    <a href="thepicture.jpg" target="photo"
    onclick="popUp("thepicture.jpg")"><img src="thumb.jpg" alt="picture" /></a>


    watch out for the word wrapping in all of that.
    SpaceGirl, May 13, 2004
    #2
    1. Advertising

  3. Ria Van Heerden

    SpaceGirl Guest


    > <a href="thepicture.jpg" target="photo"
    > onclick="popUp("thepicture.jpg")"><img src="thumb.jpg" alt="picture"

    /></a>

    oops, should be:

    <a href="thepicture.jpg" target="photo"
    onclick="popUp('thepicture.jpg')"><img src="thumb.jpg" alt="picture" /></a>
    SpaceGirl, May 13, 2004
    #3
  4. Thanks - is there a better way of displaying a larger view of a thumbnail
    ???

    "SpaceGirl" <> wrote in message
    news:...
    >
    > "Ria Van Heerden" <> wrote in message
    > news:...
    > > Hi
    > >
    > > I have small thumbnail pics on my site - I want the client to click on

    > them
    > > and then a new window will open without the toolbar and menu and the

    other
    > > stuff - displaying just the enlarged image. Can somebody help me to do

    > this
    > > I just cant seem to get it right
    > >
    > > Kind Regards
    > > Ria

    >
    >
    > You should be warned before going down this route, a *lot* of browsers

    block
    > popups like this... A good percentage of people visiting the site, upon
    > clicking the link will see nothing. Popup windows without toolbars

    requires
    > scripting;
    >
    > <script language="javascript" type="text/javascript">
    > function popUp(popupURL){
    > var myPopup =
    >

    window.open(popupURL,"photo",'toolbar=0,location=0,directories=0,status=0,me
    > nubar=0,resizable=yes,scrollbars=yes,width=550, height=550');
    > photo.focus();
    > }
    > </script>
    >
    > <a href="thepicture.jpg" target="photo"
    > onclick="popUp("thepicture.jpg")"><img src="thumb.jpg" alt="picture"

    /></a>
    >
    >
    > watch out for the word wrapping in all of that.
    >
    >
    Ria Van Heerden, May 13, 2004
    #4
  5. Ria Van Heerden

    SpaceGirl Guest

    "Ria Van Heerden" <> wrote in message
    news:...
    > Thanks - is there a better way of displaying a larger view of a thumbnail
    > ???


    Not if you want to turn toolbars off, you have no choice.

    If you just want the image to appear in a new window (with the toolbars
    turned on) then...

    <a href="myBIGpicture.jpg" target="_blank"><img src="myTHUMB.jpg" /></a>

    ....works. You cannot control anything in the browser without scripting.
    Things such as toolbars, popup windows, controlling the history etc etc are
    all things that are handled through scripts. You have to keep in mind that
    HTML is a mark-up language. It's only designed for displaying information,
    not controlling the way applications behave (such as web browsers).
    SpaceGirl, May 13, 2004
    #5
  6. Thanks

    "SpaceGirl" <> wrote in message
    news:...
    >
    > "Ria Van Heerden" <> wrote in message
    > news:...
    > > Thanks - is there a better way of displaying a larger view of a

    thumbnail
    > > ???

    >
    > Not if you want to turn toolbars off, you have no choice.
    >
    > If you just want the image to appear in a new window (with the toolbars
    > turned on) then...
    >
    > <a href="myBIGpicture.jpg" target="_blank"><img src="myTHUMB.jpg" /></a>
    >
    > ...works. You cannot control anything in the browser without scripting.
    > Things such as toolbars, popup windows, controlling the history etc etc

    are
    > all things that are handled through scripts. You have to keep in mind that
    > HTML is a mark-up language. It's only designed for displaying information,
    > not controlling the way applications behave (such as web browsers).
    >
    >
    Ria Van Heerden, May 13, 2004
    #6
  7. Ria Van Heerden

    Whitecrest Guest

    In article <>, says...
    > I have small thumbnail pics on my site - I want the client to click on them
    > and then a new window will open without the toolbar and menu and the other
    > stuff - displaying just the enlarged image. Can somebody help me to do this
    > I just cant seem to get it right


    Use either target = _blank or Javascript to open a new window
    onclick='javascript:window.open(...)

    or both

    <a href='bla.jpg target='_blank' onclick='javascript: window.open(...)>

    --
    Whitecrest Entertainment
    www.whitecrestent.com...
    Whitecrest, May 13, 2004
    #7
  8. While the city slept, SpaceGirl <> feverishly
    typed:

    >> <a href="thepicture.jpg" target="photo"
    >> onclick="popUp("thepicture.jpg")"><img src="thumb.jpg" alt="picture"
    >> /></a>

    >
    > oops, should be:
    >
    > <a href="thepicture.jpg" target="photo"
    > onclick="popUp('thepicture.jpg')"><img src="thumb.jpg" alt="picture"
    > /></a>


    Or even...

    <a href="thepicture.jpg" targer="photo" onclick="popUp('thepicture.jpg');
    return false;"> ... etc...

    The 'return false' bit stops the file in href being opened if javascript is
    available to - and enabled by - the end-user.

    Cheers,
    Nige

    --
    Nigel Moss.

    Email address is not valid. . Take the dog out!
    http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
    In the land of the blind, the one-eyed man is very, very busy!
    nice.guy.nige, May 13, 2004
    #8
  9. Ria Van Heerden

    Whitecrest Guest

    In article <>,
    says...
    > The 'return false' bit stops the file in href being opened if javascript is
    > available to - and enabled by - the end-user.


    Opps forgot that in my example too
    --
    Whitecrest Entertainment
    www.whitecrestent.com
    Whitecrest, May 13, 2004
    #9
  10. Ria Van Heerden

    Mitja Guest

    SpaceGirl <>
    (news:) wrote:
    > "Ria Van Heerden" <> wrote in message
    > news:...
    >> Hi
    >>
    >> I have small thumbnail pics on my site - I want the client to click
    >> on them and then a new window will open without the toolbar and menu
    >> and the other stuff - displaying just the enlarged image. Can
    >> somebody help me to do this I just cant seem to get it right
    >>
    >> Kind Regards
    >> Ria

    >
    >
    > You should be warned before going down this route, a *lot* of
    > browsers block popups like this... A good percentage of people


    AFAIK browsers are mostly able to distinguish between "wanted" (manually
    triggered, like here) and unwanted popups.

    > visiting the site, upon clicking the link will see nothing. Popup
    > windows without toolbars requires scripting;
    >
    > <script language="javascript" type="text/javascript">
    > function popUp(popupURL){
    > var myPopup =
    >

    window.open(popupURL,"photo",'toolbar=0,location=0,directories=0,status=0,me
    > nubar=0,resizable=yes,scrollbars=yes,width=550, height=550');
    > photo.focus();
    > }
    > </script>
    >
    > <a href="thepicture.jpg" target="photo"
    > onclick="popUp("thepicture.jpg")"><img src="thumb.jpg" alt="picture"
    > /></a>
    >
    >
    > watch out for the word wrapping in all of that.
    Mitja, May 13, 2004
    #10
  11. Ria Van Heerden

    SpaceGirl Guest

    "nice.guy.nige" <> wrote in message
    news:...
    > While the city slept, SpaceGirl <> feverishly
    > typed:
    >
    > >> <a href="thepicture.jpg" target="photo"
    > >> onclick="popUp("thepicture.jpg")"><img src="thumb.jpg" alt="picture"
    > >> /></a>

    > >
    > > oops, should be:
    > >
    > > <a href="thepicture.jpg" target="photo"
    > > onclick="popUp('thepicture.jpg')"><img src="thumb.jpg" alt="picture"
    > > /></a>

    >
    > Or even...
    >
    > <a href="thepicture.jpg" targer="photo" onclick="popUp('thepicture.jpg');
    > return false;"> ... etc...
    >
    > The 'return false' bit stops the file in href being opened if javascript

    is
    > available to - and enabled by - the end-user.
    >
    > Cheers,
    > Nige
    >
    > --
    > Nigel Moss.
    >
    > Email address is not valid. . Take the dog out!
    > http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
    > In the land of the blind, the one-eyed man is very, very busy!


    Doh. Yes :)
    SpaceGirl, May 13, 2004
    #11
  12. Ria Van Heerden

    Spartanicus Guest

    "SpaceGirl" <> wrote:

    [snip]

    >Doh. Yes :)


    Please snip quotes to the bare minimum when following up.

    --
    Spartanicus
    Spartanicus, May 13, 2004
    #12
  13. Ria Van Heerden

    SpaceGirl Guest

    "Spartanicus" <> wrote in message
    news:...
    > "SpaceGirl" <> wrote:
    >
    > [snip]
    >
    > >Doh. Yes :)

    >
    > Please snip quotes to the bare minimum when following up.
    >
    > --
    > Spartanicus


    No :p
    SpaceGirl, May 13, 2004
    #13
  14. nice.guy.nige wrote:

    > <a href="thepicture.jpg" targer="photo" onclick="popUp('thepicture.jpg');
    > return false;"> ... etc...


    Or better:

    <script language="javascript" type="text/javascript">
    function popUp(popupURL,popupTarget){
    var myPopup = window.open(popupURL,popupTarget,'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=yes,scrollbars=yes,width=550, height=550');
    photo.focus();
    return !(myPopup);
    }
    </script>

    <a href="thepicture.jpg" target="photo"
    onclick="popUp(this.href,this.target);"> <img src="thumb.jpg"
    alt="picture" /> </a>

    This way the function will return false if the popup opens OK, but if the
    popup fails to open, the function will return true, and the link will be
    followed normally.

    (untested)

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, May 13, 2004
    #14
  15. Ria Van Heerden

    Jeff Thies Guest

    > <script language="javascript" type="text/javascript">
    > function popUp(popupURL,popupTarget){
    > var myPopup =

    window.open(popupURL,popupTarget,'toolbar=0,location=0,directories=0,status=
    0,menubar=0,resizable=yes,scrollbars=yes,width=550, height=550');
    > photo.focus();
    > return !(myPopup);
    > }
    > </script>
    >
    > <a href="thepicture.jpg" target="photo"
    > onclick="popUp(this.href,this.target);"> <img src="thumb.jpg"
    > alt="picture" /> </a>
    >
    > This way the function will return false if the popup opens OK, but if the
    > popup fails to open, the function will return true, and the link will be
    > followed normally.
    >
    > (untested)


    That's my thinking on this also. I haven't had time to test this widely.

    Would someone like to throw up a test case to be checked across the range of
    popup blockers?

    It'll be some time before I can...

    Jeff
    >
    > --
    > Toby A Inkster BSc (Hons) ARCS
    > Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    >
    Jeff Thies, May 13, 2004
    #15
  16. Ria Van Heerden

    Mabden Guest

    he he
    Mabden, May 13, 2004
    #16
  17. Ria Van Heerden

    Mabden Guest

    "Whitecrest" <> wrote in message
    news:...
    > In article <>, says...
    > > I have small thumbnail pics on my site - I want the client to click on

    them
    > > and then a new window will open without the toolbar and menu and the

    other
    > > stuff - displaying just the enlarged image. Can somebody help me to do

    this
    > > I just cant seem to get it right

    >
    > Use either target = _blank or Javascript to open a new window
    > onclick='javascript:window.open(...)
    >
    > or both
    >
    > <a href='bla.jpg target='_blank' onclick='javascript: window.open(...)>
    >


    Oooohhhh... you're not going to Validate... ! http://validator.w3.org/

    --
    Mabden
    Mabden, May 13, 2004
    #17
  18. Ria Van Heerden

    Whitecrest Guest

    In article <oLPoc.7989$>,
    says...
    > > Use either target = _blank or Javascript to open a new window
    > > onclick='javascript:window.open(...)
    > > or both
    > > <a href='bla.jpg target='_blank' onclick='javascript: window.open(...)>

    > Oooohhhh... you're not going to Validate... ! http://validator.w3.org/


    Yea, I'll lose a lot of sleep over that....

    --
    Whitecrest Entertainment
    www.whitecrestent.com
    Whitecrest, May 13, 2004
    #18
  19. Ria Van Heerden

    Jeff Thies Guest

    "Whitecrest" <> wrote in message
    news:...
    > In article <oLPoc.7989$>,
    > says...
    > > > Use either target = _blank or Javascript to open a new window
    > > > onclick='javascript:window.open(...)
    > > > or both
    > > > <a href='bla.jpg target='_blank' onclick='javascript:

    window.open(...)>
    > > Oooohhhh... you're not going to Validate... ! http://validator.w3.org/

    >
    > Yea, I'll lose a lot of sleep over that....


    What about when it doesn't work? Which has nothing to do with the
    validation.

    Jeff
    >
    > --
    > Whitecrest Entertainment
    > www.whitecrestent.com
    Jeff Thies, May 13, 2004
    #19
  20. Ria Van Heerden

    Whitecrest Guest

    In article <FdQoc.8474$>,
    says...
    > > Yea, I'll lose a lot of sleep over that....

    > What about when it doesn't work? Which has nothing to do with the
    > validation.


    Yea, that will cause some loss of sleep too.

    --
    Whitecrest Entertainment
    www.whitecrestent.com
    Whitecrest, May 13, 2004
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick Olurotimi Ige

    Closing child window when opening a new Window

    Patrick Olurotimi Ige, Dec 14, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    427
    Patrick Olurotimi Ige
    Dec 14, 2004
  2. UJ
    Replies:
    2
    Views:
    7,488
    John Timney \(ASP.NET MVP\)
    Jun 27, 2005
  3. Clara
    Replies:
    6
    Views:
    572
    Clara
    Apr 25, 2005
  4. Ria Van Heerden

    Opening a image in a new window

    Ria Van Heerden, May 13, 2004, in forum: Javascript
    Replies:
    9
    Views:
    127
    Randy Webb
    May 14, 2004
  5. Allan
    Replies:
    1
    Views:
    102
    Randy Webb
    Aug 6, 2004
Loading...

Share This Page