Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    New Coder
    Join Date
    Apr 2003
    Location
    London
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Netscape exact window size problems with Netscape7

    I have scripted specifically sized windows without resize, location,scroll,tools and menu to display sequences of Flash movies. This works fine in IE and earlier Netscapes.

    In Netscape7 and Mozilla however, the windows are somewhat shorter and don't display the complete movie.

    Why is that and is there a remedy?

    --

    I also wondered whether there is a way of scripting away the new tabs in the Netscape7 browser?

    thanks

    Jorn
    Jorn

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    call the sizeToContent() method of the window and let the browser do it for you automatically.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I was about to post saying sizeToContent doesn't seem to work, then I remembered I have my JS preferences set not to allow sites to resize windows.

    It might be worth remembering that - that you can't absolutely rely on it.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #4
    New Coder
    Join Date
    Apr 2003
    Location
    London
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for your suggestion.

    do you know why this is happening?

    j
    Jorn

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You're seeing this with ns7 in tabbed browser mode, yes? Well the tabs themselves take space away from the inner canvas, but (afaics) don't report to the JS interpretor how much space has been used.

    When you open a window with specific dimensions, the numbers are the internal dimensions of the window; but, you may not actually have all that canvas, because of the tabs.

    The best solution, I think, is to attach less importance to the size of the window - give yourself margins to play with, or better yet, allow the window content itself to be flexible and take up as much or as little space as it has.
    Last edited by brothercake; 04-04-2003 at 06:35 PM.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #6
    New Coder
    Join Date
    Apr 2003
    Location
    London
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    even without tabbed browsing do NS7/Mozilla display the windows somewhat 40-60 pixels shorter. it is basically cutting off the bottom. that may well be the height of the tabs.

    strangely though, the first window seems to be opening in the exact size. only the sequence following is not doing it. probably need to place resize commands everywhere.

    thanks anyway

    j
    Jorn

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When you open a window with specific dimensions, the numbers are the internal dimensions of the window

    But when you resize an already-open window, the figures are the outer dimensions - the difference is the browser's chrome (toolbars, window borders etc)


    There is a way to calculate the chrome size though - in netscape you have the outerWidth and outerHeight properties; you can work out the chrome by calculating the difference between the inner / outer dimesnions. Or in IE can you do it like this:

    - open a window at 100 x 100
    - resize to 100 x 100
    - work out the document dimensions with document.body.offsetWidth/Height
    - the difference is the chrome size
    Last edited by brothercake; 04-05-2003 at 03:20 PM.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #8
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    document.body won't give correct values in standards mode, though. Then you have to use documentElement instead of body.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #9
    New Coder
    Join Date
    Apr 2003
    Location
    London
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the resize suggestions.

    the size to content method doesn't work. the window opens in a very huge format.

    the resize worked nicely with Mozilla but messed up the IE. it there a command that is directed at Mozilla/NS7 browsers only?

    jorn
    Jorn

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a client sniffer that might be useful to you - http://www.brothercake.com/scripts/sniffer.php
    Last edited by brothercake; 04-07-2003 at 10:43 PM.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #11
    New Coder
    Join Date
    Apr 2003
    Location
    London
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the link

    I played around with your script and shortened it like this

    if(navigator.userAgent.indexOf("netscape/7")==-1||navigator.userAgent.indexOf("netscape7")==-1){
    window.resizeTo(270,181);
    }else{
    window.resizeTo(270,171);

    NS7 likes it, but the "else" browser IE doesn't. IE follows the first resize too.

    then tried variation:
    if(navigator.userAgent.indexOf("netscape/7")!=-1, etc.
    but that doesn't make a difference

    what do I do wrong?
    Jorn

  • #12
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your first condition says "if the UA string doesn't contain netscape7 or /7"; that's why IE executed it. But the != condition won't match netscape 7 either because you're looking for "netscape" in a UA string containing "Netscape" (the capital N is the difference).

    Do this instead:

    var agt = navigator.userAgent.toLowerCase();

    if(agt.indexOf("netscape/7")!=-1||agt.indexOf("netscape7")!=-1) { ...


    But I still advise against this whole plan - the reason for wanting to discriminate is so you can resize to allow for netscape 7's tabs - but most other browsers either have, or can be extended to have tabs; and netscape 7 users may not have the tabs turned on. I really think you're better not trying to force the window to be the size of your content - but instead, allow your content to be the size of the window.
    Last edited by brothercake; 04-10-2003 at 03:01 PM.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #13
    New Coder
    Join Date
    Apr 2003
    Location
    London
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it seems that NS7 doesn't read the script. which ever way i put it it doesn't react. now IE behaves as it should but NS7 is back to chopping the bottom of the window.

    unfortunately, the movies and images are sized and positioned on the screen in precise relation to each other. they are an art piece, in which flash movie narratives move from one window screen to another. in another section photographs are diplayed in windows, and I just don't want borders as it just looks better (and particularly good on Mac OSX). Hence my reluctance to make all again, only because of netscape 7. the whole structure is based on these individual windows, are there are plenty of them.

    however, what puzzles me is that NS7 doesn't want to read the javascript commands...
    Jorn

  • #14
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can you post a link then, so we can see what happens.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #15
    New Coder
    Join Date
    Apr 2003
    Location
    London
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    took it offline for the moment.

    but check www.leifcodices.info/anfang.html. that was the index.

    j
    Jorn


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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