SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pop up resize...

    Ok confusing subject probably but here is what I have. I have 3 links on a site. They all open up new windows with different sizes but all use one function which is:
    Code:
    function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
    	if(window.screen)if(isCenter)if(isCenter=="true"){
    		var myLeft = (screen.width-myWidth)/2;
    		var myTop = (screen.height-myHeight)/2;
    		features+=(features!='')?',':'';
    		features+=',left='+myLeft+',top='+myTop;
    	}
    	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
    }
    That might be from dw or somewhere but I found it off of a website. But any ways. The three links will open up a page. But the links all require pop ups to be different sizes. So I want the pop ups to open up when they click on the link but when they click on another link I want it to close the old pop up and re-open a new pop up with that size. So it will open up one pop up with say 100x100 after you click on link 1. But then the user doesnt close that pop up and clicks on link 2 which is 300x350 in size. I want that to either resize to 300x350 or close the old pop up and open a new one becuase the new one just loads in the old pop up with the old sizes. Here is some screen shots to help you out:
    Help

    Thanks in advance,
    Ryan

    PS Sorry for the confusing explaination!
    Last edited by WhSox21; Jul 10, 2002 at 10:31.

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    FYI: Dreamweaver functions have that tag of MM_ - which allows us to know to burn the user at the stake ( Bill's gonna be on my back for that one )

    Why not assign the window to a variable.
    Then when the function runs - test for that variable.
    If the variable exists - instead of opening a new window just do a variable.resizeTo(350,350);variable.location=new;
    ?

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well since I have no knowledge of js at all could you help me a bit more? I'm more into server side languages. I don't really know how to do what you are talking about or do I know where to put it in my script. Could you help me a bit more?

    Thanks,
    Ryan Amos

  4. #4
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It might be as simple as making sure to give each popup window a different name. I remember once having the exact same problem and that's how I solved it....

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is exactly what it was. I was messing around with that code a couple days ago and tried that and it worked how I wanted it to. Thanks for the reply though. That is what the problem was.

    Thanks all,
    Ryan


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
  •