/    Sign up×
Community /Pin to ProfileBookmark

Managing two different sizes pop up windows

Hi there,
I’m having window-sizing problems an would REALLY appreciate some help.
I want on selection of button A to open new window A (which contains windows media player) in one size window.
And selection of button B to open up new window B (which contains a flash movie) in a different size window.
And I CAN do this…if both windows are opened WITHOUT th other being present.
HOWEVER, if the reader opens B when A is open, then I find that the new window (? opens in A’s window…so I get the wrong

size window for the content.
HOW CAN I GET the trigger that opens window B (button ? to CLOSE window A if it happens to be open already?
The code I am using is below…thanks so much for helping.

In the HEAD
<script language=”JAVASCRIPT” type=”TEXT/JAVASCRIPT”>
<!– Hide script from old browsers

function newWindow(vows) {
vowsWindow = window.open(vows, “demoWin”,
“top=0,left=0,width=450,height=301,scrollbars=no”)
vowsWindow.focus()
}

function newWindow1(demo) {
demoWindow = window.open(demo, “demoWin”,

“top=10,left=5,width=320,height=120,scrollbars=no”)
demoWindow.focus()
}

// End hiding script from old browsers –>

And in the BODY

A is here <a href=”javascript:newWindow(‘A.htm’)”> etc….
For B click here <a href=”javascript:newWindow1(‘B.htm’)”> etc….

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@coppocksDec 03.2006 — Both windows are both named "demoWin", change the name of one of 'em and those will be your target names.

I just posted to another about something similar...

http://www.webdeveloper.com/forum/showthread.php?t=130393

That might help you some more as it shows the relationships between windows.
Copy linkTweet thisAlerts:
@Mr_JDec 04.2006 — Try this

[code=php]<script type="text/javascript">
<!--
function openWindow(url,Left,Top,Width,Height,atts){
var newWin=open(url,'','left='+Left+',top='+Top+',width='+Width+',height='+Height+',attributes='+atts+'')
}
// -->
</script>

<a href="A.htm" onclick="openWindow(this.href,0,0,450,301,'toolbar=no');return false">Page A</a>

<a href="B.htm" onclick="openWindow(this.href,5,10,320,120,'toolbar=no');return false">Page B</a>
[/code]
Copy linkTweet thisAlerts:
@petermidiauthorDec 05.2006 — It's much appreciated.

I'll give both routes a try!

Peter
×

Success!

Help @petermidi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...