473,508 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Popup placement

Hi all,

how can place a popup window relative to the assigned
button instead of relative to the documents body?

I'm using: oPopup.show(15,150,50,50,document.body);

But the popup is shown if a button is clicked, so I like
the popup to be shown relative to the button!

Thx
Jenny
Nov 17 '05 #1
2 1107
Hi

Pass parameters where actually button positioned.
depending on that relatively open pop up window.

HTH
Ravikanth[MVP]

-----Original Message-----
Hi all,

how can place a popup window relative to the assigned
button instead of relative to the documents body?

I'm using: oPopup.show(15,150,50,50,document.body);

But the popup is shown if a button is clicked, so I like
the popup to be shown relative to the button!

Thx
Jenny
.

Nov 17 '05 #2
Hi

Do something like this to get the element pos

<head>
<script>
function icyGetElementPos(oElement){
var e = ( typeof(oElement) == "object") ? oElement : null;
var o = {x: 0, y:0};
while(e)
{
o.x += parseInt(e.offsetLeft,10);
o.y += parseInt(e.offsetTop,10);
e = e.offsetParent;
}
return o;
}
function doIt(oEl){
var o = icyGetElementPos(oEl);
alert(o.x + "/" + o.y + "\nElement posY + ElementHeight: " +
oEl.offsetHeight);
}
</script>
</head>
<body>
<form>
<input type="button" value="click me to get my pos"
onclick="doIt(this)"><br>
<input type="button" value="click me to get my pos"
onclick="doIt(this)"><br>
<input type="button" value="click me to get my pos"
onclick="doIt(this)"><br>
</form>
</body>
</html>

Hope this helps

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
"Jenny" <j.********@SPAMx-mail.net> wrote in message
news:08****************************@phx.gbl...
Hi all,

how can place a popup window relative to the assigned
button instead of relative to the documents body?

I'm using: oPopup.show(15,150,50,50,document.body);

But the popup is shown if a button is clicked, so I like
the popup to be shown relative to the button!

Thx
Jenny

Nov 17 '05 #3

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

Similar topics

3
2048
by: Steve K | last post by:
After reading Harlan's post about popups some of my questions were answered but.. I was going to use differnet popups on a lot of my pages. These popups contain bios on Cornell faculty. Two days...
23
4435
by: Giancarlo Niccolai | last post by:
Hello all. I have peeked through the FAQ and all relevant links, and also through Stroustrup book, but I have not been able to find an answer, so I have to post here as a last resort. It...
20
4116
by: Ioannis Vranos | last post by:
When we use the standard placement new operator provided in <new>, and not a definition of owr own, isn't a call to placement delete enough? Consider the code: #include <new>
15
4633
by: mangesh | last post by:
This code is from c++ faq in section 11 : void someCode() { char memory; void* p = memory; Fred* f = new(p) Fred(); f->~Fred(); // Explicitly call the destructor for the placed object }
1
11377
by: SarahT | last post by:
Hi folks, I am doing something Very Bad and Wrong (which I'll spare you the details of) that requires overloading new for some specific classes. So, for example: class MyWeirdThingy {...
5
5820
by: Lagarde Sébastien | last post by:
Hello, I write code to debug new call with following macro: #define new (MemoryManager::Get().setOwner (__FILE__, __LINE__, _FUNCTION-), FALSE) ? NULL : new The setOwner allow to save the...
15
4991
by: LuB | last post by:
I am constantly creating and destroying a singular object used within a class I wrote. To save a bit of time, I am considering using 'placement new'. I guess we could also debate this decision -...
9
3266
by: karthikbalaguru | last post by:
Hi, I find that articles stating that 'placement new' constructs an object on a pre-allocated buffer and so takes less time. Actually, we have to consider the allocation of the buffer and then...
0
5112
by: furqanms | last post by:
I have a little problem in a XAML application. When I use a popup in a WPF application, I am not able to get rid of the popup from the view even if I do Alt-Tab to move focus to other applications....
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7118
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...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7038
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...
0
7493
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...
1
5049
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...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
763
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.