SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Location
    Switzerland
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    scrollbar does not appear!

    ok I created a javascript which opens up a new window and leads to a new page. now in the old browser version there is no scrollbar! alotugh I added scrollbar="yes". what can I do?

  2. #2
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which browser version? And I think it's scrollbars -- try that.

    G

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Location
    Switzerland
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no I wrote scrollbars in the script :-)
    the affected versions are netscape 4.7 and older and explorer below 5.0. I know it's wierd, but a customer wants to work it for all the old browsers.

  4. #4
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's really odd! I use this script and it's fine in Netscape -- there may be some subtle difference -- take a look:

    <script language="javascript">

    function popWin( url, name, width, height, scroller ) {
    var outStr = 'height=' + height + ',width=' + width;
    if (scroller != 'true') {
    outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no';
    }
    else {
    outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no';
    }
    window.open(url, name, outStr);
    }

    </script>


    That's the header.

    <a href="javascript:popWin('../popwins/software.html', 'Job3', '400', '250', 'false' )">

    And an example link. This one works well with Flash too (as in popping windows out of Flash -- many don't handle that.

    G

  5. #5
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may want to change your variable names, as most of the ones you are using are reserved words. Perhaps something like this:
    Code:
    function popWin( url, winName, winWidth, winHeight, scroller )
    Also, a note about the features for window.open. By defaul, they do not show. So, by not adding a feature to the feature string, that is essentially the same thing as setting it's value to 0 (or 'no'). Likewise, if you include the feature just in name, that is the same as setting it to 1 (or 'yes'). So, you can modify your code to read like this: (this is a good opportunity for the ternary operator, so I'll use it here)
    Code:
    outStr = (scroller) ? ',scrollbars' : '';
    If you aren't familiar with the ternary operator, let me know and I'll break it down for you.
    Last edited by beetle; Jul 30, 2002 at 06:07.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  6. #6
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might need scrollbars=1

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  7. #7
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I have the same problem

    Funny that! I came here with exactly the same problem and found this.

    In my header I have a link to this .JS file

    function openup(newpage, name) {
    window.open(newpage, name, "width=500, height=500, scrollbars=yes, resizable=no, toolbar=no, status=no, location=no, menubar=no"); }
    scrollbars, width and height don't seem to work in Netscape 4.7 and I haven't cjecked the older versions of i.e yet

    Can anyone tell me what i am doing wrong? Many thanks

  8. #8
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found this and it seemed to work. Just put it where the link is and that is it.

    Maybe someone can let me know if something is wrong with this:

    <a href="#" onClick="window.open('www.url.com', 'WindowA', 'width=525,height=400,scrollbars=yes');">

  9. #9
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nothing wrong with that. When you think about it, window.open() is a function already. If you make your own function that runs window.open, it's kinda redundant. The only reason to create a function that runs window.open() is if you want to make some of the variables constant, like the width and height. That way you don't have to specify them each time you want to call a popup window.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  10. #10
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another thing I discovered today and you probably had the same problem raffael3d, is that I had spaces in this bit of the code:

    "width=500, height=500, scrollbars=yes, resizable=no, toolbar=no, status=no, location=no, menubar=no"

    When i changed it to

    "width=500,height=500,scrollbars=yes,resizable=no,toolbar=no,status=no,location=no,menubar=no");

    Everything was OK, the old browsers don't like the spaces

    Also thanks beetle but I have decided to use the old way without the spaces as I would have had to change it on most pages where the old way was lined so I only had to chabge that page.


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
  •