SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2003
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry How can I control the window size and button status when the page load.

    Hi,

    A question from a newbie.

    I need a page load with windows size in 640 x 480 and without any button bar/status bar. I know I can do that make javascript code on the original page link. However, I can't edit source from the client.

    So, is it possible to make it happen when the page load?

    Thank for your help in advanced.


  2. #2
    SitePoint Member
    Join Date
    Dec 2002
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure there's an easier way to do this, and to be honest, I took this from another site but I wan't to be able to give a helping hand so here it is.

    Within the <HEAD> and </HEAD> tags.

    PHP Code:
    <script language "JavaScript">
    <!--
    function 
    openWinwindowURLwindowName) { 

           
    screenW screen.availWidth;
           
    screenH screen.availHeight;

        if (
    document.all  || document.getElementById){
            
    popWidth 640;
            
    popHeight 480;
            
        } else if (
    navigator.appName == "Netscape" && (navigator.appVersion.indexOf("PPC") != -1)) {
            
    popWidth 640;
            
    popHeight480;
        }else{
            
    popWidth 640;
            
    popHeight 480;
        }

        
    window.open('[b]ENTER PAGE URL HERE[/b]','theWindow','width=' popWidth ',height=' popHeight ',top=' topPos ',left=' leftPos 'toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0');




    function 
    openMan (URL) { 
            
    window.open(URL'theWindow''width=640,height=480,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0');    
    }
    //-->
    </script> 
    Enter the following within the <BODY> tag

    PHP Code:
    onload="openWin()" 
    I'm not sure if i've put it in right but i'm pretty sure thats how its done.
    I think there's a lot of stuff there thats not needed but i think its pretty obvious what that is. Well, depends if your bothered about Netscape or not
    Last edited by one-x; Jan 12, 2003 at 08:50.
    one-x
    "Simplicity is the key to all things great"


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
  •