SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    googlicious graymatter bvarvel's Avatar
    Join Date
    Sep 2002
    Location
    Katy, TX
    Posts
    952
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Popup Script Problems... need assistance.

    I've got the following script that I think should work:
    PHP Code:
    function popup(mylinkwcorycor)
    {
    if (! 
    window.focus)return true;
    var 
    href;
    var 
    wdt;
    var 
    hgt;
    var 
    centerX=(screen.width-wdt)/2;
    var 
    centerY=(screen.height-hgt)/2;
    if (
    typeof(mylink) == 'string')
    href=""mylink;
    wdt=wcor;
    hgt=ycor;
    else
    href=""mylink.href;
    window.open(hrefwintitle'top='+centerY+',left='+centerX+',width='+wdt+',height='+hgt+',scrollbars=no');
    return 
    false;

    and it's being called with :

    onClick="return popup(this, 300, 200)"


    am i missing something here? i'm just trying to pass the page, desired height and width to the function... can someone help?

    brian.

    fyi - the problem is it's not opening a new window.. merely opening the page in the same window which is NOT what I want.

    thanks again.

  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)
    First off, I can see your missing braces (the { and }) around your if...else statement.
    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




  3. #3
    SitePoint Addict BenANFA's Avatar
    Join Date
    Apr 2003
    Location
    Bath, UK
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ALso you reference the variables wdt and hgt before you have initialised them.


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
  •