42 users online (1 members and 41 guests)  


  Results 1 to 3 of 3

Related

  1. Verifing Window 'size' upon Opening a File.    Forum: Javascript Forum
    Replies: 8
  2. Replies: 8
  3. Can't open (FILE,"$filename")    Forum: CGI Perl Forum
    Replies: 2
  4. Replies: 1
  5. Replies: 5
  1. #1
    grace's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2009
    Location
    Misery
    Posts
    9

    Red face Opening a file to a constant "size".

    If, anyone would like, how to make any file coded to open to width, height; as desired size, (mostly in px - but any 'mea') maybe with a scrolless field, even some more description . Again; I apologize to coothead for lack of precise detail .

  2. #2
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Opening a file to a constant "size".

    Hi there grace,

    here is an example for you to try...
    Code:
    
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    
    <title>pop-up basic method</title>
    
    <style type="text/css">
    a {
        color:#f00;
     }
    .popup {
        color:black;
    }
    </style>
    
    <script type="text/javascript">
    
    function init(){
    
    /******** editable values *******/
    
     var w=700;   // window width
     var h=400;   // window height
    
    /*******************************/
    
     var mywindow;
     var a=document.getElementsByTagName('a');
     var t=(screen.height-h)/2;
     var l=(screen.width-w)/2;
     var f='width='+w+',height='+h+',top='+t+',left='+l+',scrollbars=1';
    
    for(var c=0;c<a.length;c++) {
    if(a[c].className=='popup') {
    a[c].onclick=function() {
    if(mywindow) {
       mywindow.close();
     }
       mywindow=window.open(this.href,'',f);
       mywindow.focus();
       return false;
    
        }
       }
      }
     }
       window.addEventListener?
       window.addEventListener('load',init,false):
       window.attachEvent('onload',init);
    </script>
    
    </head>
    <body>
    
    <ul>
     <li><a class="popup" href="http://duckduckgo.com/">duckduckgo</a></li>
     <li><a href="http://www.ahfb2000.com/webmaster_help_desk/showthread.php?t=13751">not a poup</a></li>
     <li><a class="popup" href="http://blekko.com/">blekko</a></li>
     <li><a href="http://www.bbc.co.uk">not a poup</a></li>
     <li><a class="popup" href="http://google.com/">google</a></li>
    </ul>
    
    </body>
    </html>
    
    Bear in mind, though, that users may have javascript disabled or pop-ups blocked.

  3. #3
    grace's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2009
    Location
    Misery
    Posts
    9

    Re: Opening a file to a constant "size".

    Thank -you kind sir .
    Would .window make a file ~only~ open to the code specified size?

    And I must tell you, from my veiwing in the past, my apologies for asking, bluntly, after recieveing so masterful a code only previously before.