Welcome, Guest
  • Author Topic: pop up window only works in safari  (Read 1601 times)

    Niels Garbus

    • Server what's that
    • *
    • Posts: 2
      • View Profile
      • Email
    pop up window only works in safari
    « on: 09/21/04, 07:57 »
    I've done a popup start at my website www.taeve.dk, but it only seems to work in my safari browser, and not in Internet Explorer. I've used the javascript code generator here on this site, and have actully never had probs with it before.

    :-\

    Here's the code I use...

    In first frame:

    getURL ("javascript:NewWindow=window.open('http://www.taeve.dk/flash/index.html','TAEVE.DK','width=820,height=620,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No')");
    stop();


    And then on the logo (as a button):

    on (release) {
                getURL ("javascript:NewWindow=window.open('http://www.taeve.dk/flash/index.html','TAEVE.DK','width=820,height=620,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No')");
    }



    Does anyone know what I'm doing wrong???

    Garbus

    damon

    • Jr. Programmer
    • **
    • Posts: 95
      • View Profile
      • Email
    Re:pop up window only works in safari
    « Reply #1 on: 09/21/04, 09:40 »
    Hello Niels:

    Looked at your info that you gave us. This is not a true pop-up window because you have a button that opens the page.

    I have written a simple script for you.

    place this info in the heading tags

    <script language="JavaScript">
    <!--
    function MM_popupMsg(msg) { //v1.0
      alert(msg);
    }

    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }
    //-->
    </script>


    Place is this information in your body tag

    <body bgcolor="#FFFFFF" onLoad="MM_openBrWindow('popup_info.html','','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=400,height=500')" text="#000000" link="#0000FF" vlink="#0000FF" alink="#FF9933">
    <table width="655" cellspacing="3" align="left">

    Note 'popup_info.html' is your link

    If you want to have the button open the link then assign the button to the link:
    some thing like this.
    http://lahabracyclery.com

    hope this helps
    -damon
    « Last Edit: 09/21/04, 09:40 by damon »

    Dirk Watkins

    • Server what's that
    • *
    • Posts: 13
      • View Profile
      • Dirk Watkins
    Re:pop up window only works in safari
    « Reply #2 on: 10/25/04, 14:58 »
    Code: [Select]



    var popUpWin=0;
    var popUpPrintWin=0;

    /***************************************************/
    /* popUpWindow                                     */
    /* opens up a new window with width and height     */
    /* specified - if dimensions are not specified it  */
    /* defaults to a percentage of the users screen    */
    /***************************************************/

    function popUpWindow(URLStr, width, height) {
       var frameWidth;
       var frameHeight;
       
       if (self.innerWidth) {
          frameWidth = self.innerWidth;
          frameHeight = self.innerHeight;
       } else if (document.documentElement && document.documentElement.clientWidth) {
          frameWidth = document.documentElement.clientWidth;
          frameHeight = document.documentElement.clientHeight;
       } else if (document.body) {
          frameWidth = document.body.clientWidth;
          frameHeight = document.body.clientHeight;
       } else {
          //could return here
          width = 400;
          height = 400;
       }
       
       frameWidth=parseInt(frameWidth);
       frameHeight=parseInt(frameHeight);
       
       //if width and height are not specified give them percentages of the window
       if (width == null) { width = frameWidth * .5; }
       if (height == null) { height = frameHeight * .7; }
       
       var left = (frameWidth/2) - width/2;
       var top = (frameHeight/2) - height/2;
       
       if(popUpWin) { if(!popUpWin.closed) popUpWin.close(); }
       
       popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
       //popUpWin.setFocus();
    }





    try that and let me know if it works for you:  http://www.dirq.net  

    -Dirk Watkins