#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Winnipeg, Manitoba
    Posts
    2
    Rep Power
    0

    Scrollbar problems in javascript popup window


    Hi there. I am using the following script to open links in pop-up windows. I want the scrollbars turned on. The script works great when I test it on my Mac, but when I test on a PC I don't get the scrollbars. Both are using IE. Any ideas?

    <script language="javascript" type="text/javascript">
    <!-- hide this from non-JS browsers
    function openWindow() {
    var popUpWin = window.open("","popup","scrollbar=1, width=700, height=500, left=25, top=25");
    }
    // stop hiding -->
    </script>

    <a href="http://www.expedia.com" onclick="openWindow()" target="popup">Getting here.</a>
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2003
    Posts
    804
    Rep Power
    100
    Try...
    Code:
    <script language="javascript" type="text/javascript"> 
    <!-- hide this from non-JS browsers 
    function openWindow() { 
    var popUpWin = window.open("","popup","scrollbars=yes, width=700, height=500, left=25, top=25"); 
    } 
    // stop hiding --> 
    </script> 
    
    <a href="http://www.expedia.com" onclick="openWindow()" target="popup">Getting here.</a>
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Winnipeg, Manitoba
    Posts
    2
    Rep Power
    0
    Thank you so much! They're finally working.
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2003
    Posts
    804
    Rep Power
    100
    No problem.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Oz
    Posts
    36
    Rep Power
    12
    Are there any compatibility issues with scrollbars=yes against scrollbars=1 or was the problem with the term scrollbar/scrollbars?
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    33
    Rep Power
    11
    scrollbars=yes is the standard notation. Maybe scrollbar=1 worked on the Mac (I'd never seen that notation before) but scrollbars=yes should work on all platforms.

    Incidentally, the default is scrollbars=auto, which supplies scrollbars only if they're needed, and is my preference. If you don't supply a scrollbars value at all, the browser assumes a default of "auto" and supplies them as needed.
    Bill

IMN logo majestic logo threadwatch logo seochat tools logo