SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Location
    Buffalo, NY
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pop-up window problems

    I am closing in on finishing my first PHP/MySQL CMS site, and I just discovered a problem with one of my active content test pages. Each thumbnail image on this page should open a pop-up window to display the associated full size image. The code shown below is the same that would be used for each thumbnail on the page (with different values filled in, of course)

    <div>
    <a href="#" onclick="MM_openBrWindow('../fullSizeImg.php?period=recent&id=1','Blue Enigma','scrollbars=no,width=625,height=622')">
    <img src="images/zblueenigma.jpg" width="90" height="90" alt="Blue Enigma" /></a>
    </div>

    Now, this is working fine in Firefox... but IE just shows "Error on Page" down in the lower left hand corner after you click on any thumbnail. Opera opens the target file, but in a full sized window.

    These problems only occur with the active content page, which is at:

    http://www.markdivincenzo.com/newpai...?period=recent

    The pop-up window works fine in any browser with static content. The static content page is at:

    http://www.markdivincenzo.com/recent.php

    The thumbnails on this page are using this code:

    <div>
    <a href="#" onclick="MM_openBrWindow('blueenigma.htm','','scrollbars=no,width=615,height=615')">
    <img src="images/zblueenigma.jpg" width="90" height="90" alt="" /></a>
    </div>

    Both the static and the dynamic content page are using the same javascript, which is:

    function getImgHeight(imgURL) {
    myImage = new Image();
    myImage.src = imgURL;
    var h = myImage.height;
    h = h + 15;

    return h;
    }


    function getImgWidth(imgURL) {
    myImage = new Image();
    myImage.src = imgURL;
    var w = myImage.width;
    alert(w);
    w = w + 15;

    return w;
    }


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


    The problems are coming up in IE 6.0 and Opera 8.54

    Does anyone have any idea how to fix these issues ? Any help is greatly appreciated.

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a JavaScript issue. Try asking an Advisor to move this thread for you so the JavaScript gurus can see the thread and thus be better able to help you. I'd take a stab at it right now, but I've been up for 26 hours and I need to get some sleep.

  3. #3
    SitePoint Evangelist ikeo's Avatar
    Join Date
    Oct 2004
    Location
    Austin Texas
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remove the spaces from the second argument in the function you're calling so its
    MM_openBrWindow('blueenigma.htm','blue_enigma','scrollbars=no,width=615,height=615')
    instead of
    MM_openBrWindow('blueenigma.htm','blue enigma','scrollbars=no,width=615,height=615')

    That parameter is a variable name not a window title so its choking on the spaces.

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Location
    Buffalo, NY
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That did the trick ! Thanks for your help.


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
  •