Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to manage 2 'sized' new windows?

Status
Not open for further replies.

petermidi

Technical User
May 24, 2006
20
GB
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 eing present.
HOWEVER, if the reader opens B when A is open, then I find that the new window (B) 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 B) 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....
 
Your opening a window with the same name for both instances.
Name the windows differently
Code:
change:
vowsWindow = window.open(vows, "[red]demoWin[/red]",...

demoWindow = window.open(demo, "demoWin",...

to

vowsWindow = window.open(vows, "[red]vowsWin[/red]",...


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top