HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Popup window question
Post new topic   Reply to topic    HTML Help Forum -> General HTML
View previous topic :: View next topic  
Author Message
Abrasha



Joined: 14 Oct 2004
Posts: 1
Location: San Francisco

PostPosted: Thu Oct 14, 2004 7:33 pm     Popup window question Reply with quote

I just created my first popup windows for my site.

I did a number of things right. Unfortunately, I have not been able to figure out a couple of other things yet.

Please go to my site at http://www.abrasha.com

- Enter the site by clicking on the picture with the ring.
- Click on "3D Design" on the left.
- Click on "Bracelets"

The top two bracelets (in the thumbnails frame) link to pages that have links to popup windows. (On both it says "Click here, to see the finished piece")

Both popups work fine, but when one popup is open, and one then clicks the link to the other popup, the size of the window does not change to the size of the new popup. It stays the same. How do I change that.

If you take a look at the source code for the pages, you will see, that I do not have any scripts in the headers of those pages. I wonder if that is the reason that this does not work right.

The other thing that does not work the way I want it to, is that when one popup window is open, and one goes back to the "regular" browser window to open another page in the main frame (at which time the popup moves to the back), the new popup window STAYS in the back. I want it to open in the front, as the first one did.

I do not want to open an additional popup window. I would like there always to be just one window. I do not like sites that employ multiple popup windows. Sometimes, after having visited such a site, I have to close dozens of separate windows. I do not want to do this to my visitors.

What do I have to do differently to make my popups do these two things differently. To recoup, this is what I want.

1 Each popup window should be the correct size, while replacing the previously open window.

2 The popup window that was opened last, should open in front, just as the first one did.
nagasree



Joined: 21 Sep 2004
Posts: 82
Location: Hyderabad, India

PostPosted: Fri Oct 15, 2004 10:41 pm     Reply with quote

Hi,
Its simple you need a global variable holding the window status, and this needs a .JS file.
Code:

</head>
<!--
Include the Script file in all the required htm pages -- Nagasree
-->
<script language="javaScript" src="PopupWindow.js"></script>

<body bgcolor="#FFFFFF" text="#000000">


Code:

<!--
Check for the modified link below.. -- Nagasree
-->
<a href="javascript:OpenViewPopup('http://www.abrasha.com/popups/bracelets/tortoise_shell_bracelet.htm')">here</a>,
to see the finished piece


Now coming to opening the code save the following content into PopupWindow.js and Place the .Js file in same location as that of your htm files.

Code:

<!--
var myWindow;
   
function OpenViewPopup(url)
{   
   var width = 520;
   var height = 410;
   var xPos = (screen.width-width)/2;
   var yPos = (screen.height-height)/2;

   var toolOptions = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,';
   var windowPosOptions = 'width='+width+',height='+height+',left='+xPos+',top='+yPos

   myWindow=window.open(url,'MyWindow',toolOptions+','+windowPosOptions);
   myWindow.focus(); //This will bring the current window on to top..
}
   
//-->



Hope this is what you want..
-Nagasree
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> General HTML All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial