473,803 Members | 3,913 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pop Window

I've installed the following Javascript on my Web page and it
is working fine. It brings up a little pop up message (not an ad).

<script language="JavaS cript"><!--
window1=window. open('sera.html ','messageWindo w1','scrollbars =no,width=150,h eight=245')
//--></script>

I'd like to make the following improvements:

1. I want to control where the pop up window
appears (so it doesn't pop up over the best
part of the page). Is there any way to
specify how many pixels from the top and to
the right that the upper left corner of the
pop up window should appear?
2. I want to make the pop up window remain on top
of the main page until the pop up window is
closed.
3. I want the pop up window to close after
fifteen to thirty seconds.

Can anyone tell me how to do this?
Fred

Jul 20 '05 #1
3 1899
Fred Atkinson <fa*******@mish mash.com> wrote in message news:<45******* *************** **********@4ax. com>...
I've installed the following Javascript on my Web page and it
is working fine. It brings up a little pop up message (not an ad).

<script language="JavaS cript"><!--
window1=window. open('sera.html ','messageWindo w1','scrollbars =no,width=150,h eight=245')
//--></script>

I'd like to make the following improvements:

1. I want to control where the pop up window
appears (so it doesn't pop up over the best
part of the page). Is there any way to
specify how many pixels from the top and to
the right that the upper left corner of the
pop up window should appear?
2. I want to make the pop up window remain on top
of the main page until the pop up window is
closed.
3. I want the pop up window to close after
fifteen to thirty seconds.

Can anyone tell me how to do this?
Fred

hello,

1.
you can use :
window1=window. open('sera.html ','messageWindo w1','scrollbars =no,width=150,h eight=245.
top=XXX, left=XXX')
and replace XXX with the offset you want

2.
to do this you need the new window to be a dialog. ( because you can
control its model/modeless )
more info here : http://www.webreference.com/js/column90/6.html
3.
you need to do make a timer that fires after 30 seconds and call
window.close()

more info:
http://www.google.com/search?hl=en&l...=Google+Search
http://www.crowes.f9.co.uk/Javascript/timer.htm

hope that was helpful

regards,
Amr Mostafa
Jul 20 '05 #2
Fred Atkinson wrote:
I've installed the following Javascript on my Web page and it
is working fine. It brings up a little pop up message (not an ad).

<script language="JavaS cript"><!--
window1=window. open('sera.html ','messageWindo w1','scrollbars =no,width=150,h eight=245')
//--></script>

I'd like to make the following improvements:

1. I want to control where the pop up window
appears (so it doesn't pop up over the best
part of the page). Is there any way to
specify how many pixels from the top and to
the right that the upper left corner of the
pop up window should appear?
The 3rd parameter of window.open() contains the attributes of the newly opened window, two
of the available attributes are top and left, of course, you must realize you will have no
idea where the browser window is on the user's screen, or where the "best part of the
page" resides, so knowing you can open the popup someplace else is pointless, because you
could open the popup at 700 x 500, and it *still* might be covering the "best part of the
page" because of where the user's browser window is positioned and where he is scrolled
to.
2. I want to make the pop up window remain on top
of the main page until the pop up window is
closed.
This can't be done reliably. Some people try to make it happen with <body
onblur="window. focus();"> but that just breaks the usability of the end-user's browser.
3. I want the pop up window to close after
fifteen to thirty seconds.
<body onload="var t = setTimeout('win dow.close();', 30000);">
Can anyone tell me how to do this?


All of the above assumes you'll even be able to open the window in the first place. If
it's an unrequested popup, most browsers and many add-ons for browsers that don't support
it natively now block unrequested new windows. In a browser like Opera, you will simply
*not* be able to place the popup where you want it, and in attempting to do so, may place
it somewhere inaccessible to the user.

In general, popups are a bad idea, find another way to present the content you want the
user to see.

--
| Grant Wagner <gw*****@agrico reunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #3
@SM


Fred Atkinson a *crit :

I've installed the following Javascript on my Web page and it
is working fine. It brings up a little pop up message (not an ad).

<script language="JavaS cript"><!--
window1=window. open('sera.html ','messageWindo w1','scrollbars =no,width=150,h eight=245')
//--></script>

I'd like to make the following improvements:

1. I want to control where the pop up window
appears (so it doesn't pop up over the best
part of the page). Is there any way to
specify how many pixels from the top and to
the right that the upper left corner of the
pop up window should appear?
top=xxx xxx = the correct value for top margin betwen internal top hedge of screen
and external top hedge of popup
left=yyy same for left margin

attributes = 'scrollbars=no, width=150,heigh t=245,top=xxx,l eft=yyy';
window1=window. open('sera.html ','messageWindo w1',attributes) ;
2. I want to make the pop up window remain on top
of the main page until the pop up window is
closed.
<body onblur="self.fo cus();">
3. I want the pop up window to close after
fifteen to thirty seconds.


<body onblur="self.fo cus();" onload="setTime out('self.close ()',30000);">

--
******** (enlever/remove [OTER_MOI] du/from reply url) *******
Stéphane MORIAUX : mailto:st****** *************** @wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
*************** *************** *************** *************** **
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
9712
by: Carol Lyn | last post by:
Could use your assistance with this. I have a window that opens via onclick and it is a small window with info about a site. If the user is interested in visiting that site, there is a link to click that opens the site in a new and larger window via onclick. My question is, can I have the smaller window automatically close when the user clicks the link to visit the site? I also have a link that merely closes the smaller info window if...
2
2199
by: Juan Garcia | last post by:
Subject says it all. Given: Window A with text field. Window B with a button (onClick opens Window C) Window C with a button (onClick I want it to modify text fields of Window A) I have tried storing the handle of Window A ( var winHandle = this; ) in a global variable/file ( globals.js ) and then accessing it from
6
5649
by: David Hayes | last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12 AM): > > >I want to maximize the browser window when I open a new window. > > function expand() { > window.moveTo(0,0); > window.resizeTo(screen.availWidth, screen.availHeight); > }
19
31076
by: Darren | last post by:
I have a page that opens a popup window and within the window, some databse info is submitted and the window closes. It then refreshes the original window using window.opener.location.reload(). The problem is that after the reload, it brings you right to the top of the page. When I click 'refresh" on the original page, it brings me back to the original viewing position. Is there a way to duplicate this in from the popup window. Also,...
14
11100
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin = window.open('images/KJV-THANKS.gif', 'Thanks', 'width=243,height=420,'); cwin.focus();
1
11591
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution. ...
26
5694
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized several parts of the DOM, but this does not include the window object. Thank you
4
6413
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database to look a and I am loosing tremendious amounts of time trying to organize it so that I could view it. Regards, Alexandre Brisebois
5
7536
by: asadhkhan | last post by:
I have the following code which works correctly in IE 6, but in IE 7, Fire Fox 2.0 and Netscape 8 it does not work. I have a main page where a button calls this pop-up and uploads a file once you click the attach it should upload file and close the window and send back control to Main page.. But it is not happening.. CODE: ========= <script LANGUAGE="JavaScript"> if ((window.opener != null) && (! window.opener.closed)) {
24
8231
by: Jeremy J Starcher | last post by:
While reading c.l.j, I've noticed that some people prefer and indeed even recommend the use of "window.alert()" over "alert()". I can't find any technical reason to make this distinction, and seems to have a (tiny) amount overhead since window itself points to the global object, hence, a circular reference. (From everything I am reading, window is just a REFERENCE back to the global object, as opposed to a separate object.)
0
9564
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.