SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Pop up problem

Hybrid View

  1. #1
    Technically, a bit dim macdan's Avatar
    Join Date
    Feb 2001
    Location
    London
    Posts
    344
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pop up problem

    Hi sitepoint

    am using a script for pop ups which doesn't want to work in the mac/internet explorer combo (it's fine on pc/ie and mac/Netscape combos) - the window just keeps on coming up and flashing lots. Would be really grateful if anyone can provide some assistance in debugging.

    The Script:

    function ViewImage(ifile,ix,iy,ititle) {
    var win;
    var sWidth;
    var sHeight;
    var NS = (document.layers) ? 1 : 0;
    win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no,top=20,left=20");
    if (NS) {
    sWidth = win.innerWidth;
    sHeight = win.innerHeight;
    } else {
    sWidth = win.document.body.clientWidth;
    sHeight = win.document.body.clientHeight;
    }
    if(sWidth!=ix || sHeight!=iy) {
    win.close();
    setTimeout("ViewImage('"+ifile+"',"+ix+","+iy+",'"+ititle+"')", 250);
    return;
    }
    win.document.open();
    win.document.write("<html><head><title>"+ititle+"</title>");
    win.document.write("</head><body>");
    win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
    win.document.write("<img src="+ifile+"></div></body></html>");
    win.document.close();
    }


    Which is being called with:

    <a href="javascript:ViewImage('image.gif',636,450,'Image Title')">My pop up link</a>


    Thanks for any help!!
    gorillaweb is a small London based digital design agency.

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just found a good site recently that has pretty reliable compatibility information for the DOM and scripting in general. Check the 'xBrowser DOM' link in my signature...

    I haven't delved real deep into myself yet...so no assitance from me for the time being....

    Best of luck...
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •