resize window

Discussion in 'Javascript' started by windandwaves, Jan 18, 2006.

  1. windandwaves

    windandwaves Guest

    Hi Folk

    I use a pop-up window on www.wapitipark.co.nz to view images.

    On some sites, I saw (a long time ago) a trick where they use Javascript to
    resize the window to the size of the image.

    Do you know how to do this?

    TIA

    Nicolaas
     
    windandwaves, Jan 18, 2006
    #1
    1. Advertising

  2. windandwaves wrote:
    > Hi Folk
    >
    > I use a pop-up window on www.wapitipark.co.nz to view images.


    Why?

    > On some sites, I saw (a long time ago) a trick where they use
    > Javascript to resize the window to the size of the image.
    >
    > Do you know how to do this?


    Yes, and I know why it is no longer a viable practice.

    Richard.
     
    Richard Cornford, Jan 18, 2006
    #2
    1. Advertising

  3. windandwaves

    windandwaves Guest

    Richard Cornford wrote:
    > windandwaves wrote:
    >> Hi Folk
    >>
    >> I use a pop-up window on www.wapitipark.co.nz to view images.

    >
    > Why?


    Just have a look at the site, it seems to be nice for the flow of the site.

    >> On some sites, I saw (a long time ago) a trick where they use
    >> Javascript to resize the window to the size of the image.
    >>
    >> Do you know how to do this?

    >
    > Yes, and I know why it is no longer a viable practice.


    Why is it no longer a viable practice?
     
    windandwaves, Jan 18, 2006
    #3
  4. windandwaves wrote:
    > Richard Cornford wrote:
    >> windandwaves wrote:
    >>> Hi Folk
    >>>
    >>> I use a pop-up window on www.wapitipark.co.nz to view
    >>> images.

    >>
    >> Why?

    >
    > Just have a look at the site, it seems to be nice for
    > the flow of the site.


    No. Wading through an arbitrary web site to see if my perception
    experiences some vague notion of "nice for the flow" as being valid is
    not a useful application of my time. If you cannot explain why you are
    doing something in a clear written statement I will conclude that you do
    not know yourself.

    >>> On some sites, I saw (a long time ago) a trick where they use
    >>> Javascript to resize the window to the size of the image.
    >>>
    >>> Do you know how to do this?

    >>
    >> Yes, and I know why it is no longer a viable practice.

    >
    > Why is it no longer a viable practice?


    Because in addition to the user having an absolute veto over the opening
    of new windows (rendering any design predicated upon the successful
    opening of new windows unreliable), they also now have an absolute veto
    on the scripted re-sizing of any new windows that they allow to be
    opened.

    Richard.
     
    Richard Cornford, Jan 22, 2006
    #4
  5. "Richard Cornford" <> writes:

    > windandwaves wrote:
    >> Just have a look at the site, it seems to be nice for
    >> the flow of the site.


    ....
    > If you cannot explain why you are
    > doing something in a clear written statement I will conclude that you do
    > not know yourself.


    My interpretation, and correct me if I'm wrong, is that "nice for the
    flow" means approx. the same as the usability slogan "principle of
    least surprise" - what most users expect.

    It might or might not be true.

    If it's for an image gallery, I would prefer to open the image in the
    same window, since that allows me to use my browser's intelligent
    "next" feature to walk through the large images. Also, using the "back"
    button is still more natural than closing windows.


    /L
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Jan 23, 2006
    #5
  6. Lasse Reichstein Nielsen wrote :
    > "Richard Cornford" <> writes:
    >
    >> windandwaves wrote:
    >>> Just have a look at the site, it seems to be nice for
    >>> the flow of the site.

    >
    > ...
    >> If you cannot explain why you are
    >> doing something in a clear written statement I will conclude that you do
    >> not know yourself.

    >
    > My interpretation, and correct me if I'm wrong, is that "nice for the
    > flow" means approx. the same as the usability slogan "principle of
    > least surprise" - what most users expect.
    >


    Hello Lasse :)

    The caption/legend of the images should clearly indicate that clicking
    on the images would create a secondary window with its enlarged image,
    as recommended by WAI guidelines.


    > It might or might not be true.
    >


    I'd say it's not the case here.

    > If it's for an image gallery, I would prefer to open the image in the
    > same window,


    Absolutely. Furthermore because each of the secondary window requests
    the same window dimensions. So reusing, recycling the same secondary
    window would be more user-friendly for the users' system resources.

    since that allows me to use my browser's intelligent
    > "next" feature to walk through the large images.


    Yep. An prefetch feature too.

    Also, using the "back"
    > button is still more natural than closing windows.
    >
    >
    > /L


    Yep.

    Gérard
    --
    remove blah to email me
     
    Gérard Talbot, Jan 23, 2006
    #6
  7. windandwaves wrote :
    > Hi Folk
    >
    > I use a pop-up window on www.wapitipark.co.nz to view images.
    >
    > On some sites, I saw (a long time ago) a trick where they use Javascript to
    > resize the window to the size of the image.


    Most of what your markup and javascript code do on your page is pretty
    wrong, definitely improvable.

    - as coded, your links will not work if javascript support is disabled
    or inexistent
    - your thumbnails do not indicate that clicking on them will show an
    enlarged image in a distinct window
    - your alt attribute for the image is illogical. Alt attribute should
    render textual replacement. So, "CLICK TO SEE A LARGER IMAGE" should not
    be in the alt attribute value.
    - <a href="#" is dysfunctional when javascript support is disabled or
    inexistent
    - your window.open call is making your enlarged page non-resizable: this
    is not recommendable and not accessibility-wise
    - your window.open call is explicitly removing scrollbars even if they
    are needed, even if document box overflows requested window dimensions:
    again, this is not recommendable and not accessibility-wise
    - the windowName you choose in your window.open call should be the same
    for a given target attribute otherwise you're creating a different
    behavior for those with javascript support and for those without
    javascript support

    You should first start by addressing such issues before trying to
    "resize" popup windows:

    DOM:window.open
    Best practices:
    http://developer.mozilla.org/en/docs/DOM:window.open#Best_practices
    Usability issues:
    http://developer.mozilla.org/en/docs/DOM:window.open#Usability_issues

    Your webpage also suffers from many more simple but important problems,
    I'd say, than from a non-resizable window via script. Some of them:
    - table-based design
    - duplication of title and alt attribute values: you do not seem to know
    which one to use and for what purpose
    - over-declaring duplicated keywords in meta tag will get you the
    reverse of what you're trying to do. Just think for a min: if everyone
    does what you do, then everyone will defeat the purpose+capabilities of
    indexing robots. Over-listing keywords just achieves the reverse of the
    original intent: indexing engines penalize such sites.
    - over-declaring and over-defining the title attribute everywhere
    etc,etc.

    Your webpage should be as usable, worthy and friendly even if I am using
    a text browser like Lynx 2.8.5 .

    Gérard
    --
    remove blah to email me
     
    Gérard Talbot, Jan 23, 2006
    #7
  8. windandwaves

    windandwaves Guest

    Gérard Talbot wrote:
    > windandwaves wrote :
    >> Hi Folk
    >>
    >> I use a pop-up window on www.wapitipark.co.nz to view images.
    >>
    >> On some sites, I saw (a long time ago) a trick where they use
    >> Javascript to resize the window to the size of the image.

    >
    > Most of what your markup and javascript code do on your page is pretty
    > wrong, definitely improvable.
    >
    > - as coded, your links will not work if javascript support is disabled
    > or inexistent
    > - your thumbnails do not indicate that clicking on them will show an
    > enlarged image in a distinct window
    > - your alt attribute for the image is illogical. Alt attribute should
    > render textual replacement. So, "CLICK TO SEE A LARGER IMAGE" should
    > not be in the alt attribute value.
    > - <a href="#" is dysfunctional when javascript support is disabled or
    > inexistent
    > - your window.open call is making your enlarged page non-resizable:
    > this is not recommendable and not accessibility-wise
    > - your window.open call is explicitly removing scrollbars even if they
    > are needed, even if document box overflows requested window
    > dimensions: again, this is not recommendable and not
    > accessibility-wise - the windowName you choose in your window.open
    > call should be the same for a given target attribute otherwise you're
    > creating a different behavior for those with javascript support and
    > for those without javascript support
    >
    > You should first start by addressing such issues before trying to
    > "resize" popup windows:
    >
    > DOM:window.open
    > Best practices:
    > http://developer.mozilla.org/en/docs/DOM:window.open#Best_practices
    > Usability issues:
    > http://developer.mozilla.org/en/docs/DOM:window.open#Usability_issues
    >
    > Your webpage also suffers from many more simple but important
    > problems, I'd say, than from a non-resizable window via script. Some
    > of them: - table-based design
    > - duplication of title and alt attribute values: you do not seem to
    > know which one to use and for what purpose
    > - over-declaring duplicated keywords in meta tag will get you the
    > reverse of what you're trying to do. Just think for a min: if everyone
    > does what you do, then everyone will defeat the purpose+capabilities
    > of indexing robots. Over-listing keywords just achieves the reverse
    > of the original intent: indexing engines penalize such sites.
    > - over-declaring and over-defining the title attribute everywhere
    > etc,etc.
    >
    > Your webpage should be as usable, worthy and friendly even if I am
    > using a text browser like Lynx 2.8.5 .
    >
    > Gérard


    Thanks for the feedback.... Will implement. Totally agree. I made this
    site a long time ago and I have learned a lot since.
     
    windandwaves, Jan 25, 2006
    #8
    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. al

    Window Resize in IE 5.0?

    al, Apr 2, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    584
    Jim Cheshire [MSFT]
    Apr 5, 2004
  2. DC Gringo

    resize window refreshes screen

    DC Gringo, Apr 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    372
    DC Gringo
    Apr 6, 2004
  3. RJN
    Replies:
    0
    Views:
    455
  4. RJN
    Replies:
    0
    Views:
    444
  5. Replies:
    2
    Views:
    1,265
    Adrienne
    Feb 13, 2005
Loading...

Share This Page