 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
Abrasha
Joined: 14 Oct 2004 Posts: 1 Location: San Francisco
|
Posted: Thu Oct 14, 2004 7:33 pm Popup window question |
|
|
|
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
|
Posted: Fri Oct 15, 2004 10:41 pm |
|
|
|
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 |
|
|
|
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
|
|
|
|
|
 |
|
|
|
|
|
|
|