Hi ~

I am trying to keep two children windows open at the same time as the parent. Umfortunately while opening the link to the second child window the first one minimizes. Is there a way around this? I have tried focus() on the second and not the first - have also tried focus on both. Neither work. Also I need the first win to be iframe, no scrollbars. Thanks for your help.

Code:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>start</title>
   <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>	

<script type="text/javascript">
	  	
	var myWin1;   //global scope

	$(document).ready(function() {

	  $('#newWin2').click(function(evt) {
		var myWin2 = open('','win2','height=500,width=400');
		evt.preventDefault();
		var html = '<h3>kitty</h3>';
		html += '<body style="background-color:#FFFF90; padding:20px; margin:5px;"><img src="kitty.jpg"></body><br />';
		html += '<button id="myWin1" onclick="opener.myWin1.close();">ByeBye Ducky!</button>';
		myWin2.focus();
		myWin2.document.write(html);
	  });
	  
	  	
 
 
	  $('#newWin1').click(function() {
		myWin1 = open('','win1','height=550,width=450,left=600');
		var html = '<h3>ducky</h3>';
		html += '<img src="ducky.jpg"><br />';
		myWin1.focus();
		
		myWin1.document.write(html);
	  });

	});

   	 </script>
    
  </head>


  <body>
  <div style=margin-left: 40px;margin-bottom: 20px; margin-top:25px;">
  
<p style="margin-left:10px">
   <button id="newWin1">Ducky</button>
</p>
	
	<p style="margin-left:15px; font-family:arial; font-size:20px; font-family: Arial Rounded MT Bold;text-decoration: none;">
   <a id="newWin2" href="kitty.html" target="_blank">kitty</a></p>

</div>

  </body>

</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.