The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 3 of 3

Thread: [javascript] simple pop-up question

  1. #1

    [javascript] simple pop-up question

    i'm using the following script to open a pop up window, but when i do, i need there to be a scrollbar and i'm not sure where to add that in the code.

    thanks in advance!

    my best,
    david

    Code:
     <html>
     <head>
     <script type="text/javascript">
     //<![CDATA[
     function popup(url,windowname,width,height) {
         width=(width)?width:screen.width/3;
         height=(height)?height:screen.height/3;
         var screenX = (screen.width/2 - width/2);
         var screenY = (screen.height/2 - height/2);
         var features= "width=" + width + ",height=" + height;
         features += ",screenX=" + screenX + ",left=" + screenX;
         features += ",screenY=" + screenY  +",top=" + screenY;
         var mywin=window.open(url, windowname, features);
         if (mywin) 
             mywin.focus();
         return mywin;
     }
     //]]>
     </script>
     </head>
     <body>
    
     Popup example:<br />
    
     <a href="http://www.google.com"  onclick="popup(this.href,'win1',400,300);return false">
         Google.com in centered sized window</a>
    
     </body>

  2. #2
    Code:
     <html>
     <head>
     <script type="text/javascript">
     //<![CDATA[
     function popup(url,windowname,width,height) {
         width=(width)?width:screen.width/3;
         height=(height)?height:screen.height/3;
         var screenX = (screen.width/2 - width/2);
         var screenY = (screen.height/2 - height/2);
         var features= "width=" + width + ",height=" + height;
         features += ",screenX=" + screenX + ",left=" + screenX;
         features += ",screenY=" + screenY  +",top=" + screenY;
    
    features += ",scrollbars=yes";
    
         var mywin=window.open(url, windowname, features);
         if (mywin) 
             mywin.focus();
         return mywin;
     }
     //]]>
     </script>
     </head>
    Add the line in red above. I believe that's all you should need.
    Γνώθι Σεαυτόν

  3. #3

    Quote Originally Posted by Ankou
    Code:
    features += ",scrollbars=yes";
       
     


    Add the line in red above. I believe that's all you should need.


    worked perfectly. thank you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012