Results 1 to 3 of 3

Thread: Pop-Up windows in IE7

  1. #1
    Join Date
    Feb 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Pop-Up windows in IE7

    Hello All,

    First time poster, long time viewer... need a little help...

    I'm trying to generate a small pop-up window to show some copy.

    I found this code from a generator on this site...

    <script language="javascript" type="text/javascript">
    <!--
    /****************************************************
    Author: Eric King
    Url: http://redrival.com/eak/index.shtml
    This script is free to use as long as this info is left in
    Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
    ****************************************************/
    var win=null;
    function NewWindow(mypage,myname,w,h,scroll,pos){
    if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
    if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
    else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,re sizable=no';
    win=window.open(mypage,myname,settings);}
    // -->
    </script>

    The pop-up works perfectly with the size requirements I set in Firefox and friends, but once I test it in Internet Explorer 7, it pretty much ignores all attributes and opens the pop-up window in _self.

    I just want it to function in all platforms...

    Thanks for your time!

    ~Tyler

  2. #2
    Join Date
    Feb 2008
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi, Tyler,

    I'd suggest not using traditional popups for many reasons, one being that browser popup blockers often interfere with these kinds of scripts. The other is that it's difficult to get the same results across all browsers, especially when it comes to showing/hiding window elements within that popup.

    Instead, you could use one of the modal alerts found in the Ajax section of Dynamic Drive, or go to www.ajaxrain.com and do a search for "modal" or "alert" and you'll find a variety of scripts to choose from.

    Good luck!

    UC

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Right. Another reason not to use traditional pop ups is, even when they are allowed, browsers may be configured to do something else with them, other than what is expected (like launch in the same window, or launch in a new tab). That appears to be the case here, though the value you are passing to it as myname may simply be invalid from IE 7's point of view. This is a fairly good DD script for pseudo pop ups:

    http://www.dynamicdrive.com/dynamici...ndow/index.htm
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •