[Javascript] Changin pop up location?
Peter Brunone
peter at brunone.com
Wed Mar 12 01:02:17 CDT 2008
Hi Skip,
I haven't looked lately, but are pageX and pageY integers or do they include units? If the former, then you may need to add the units since the current standards require them.
Just typing out loud here...
Peter
----------------------------------------
From: Skip Evans skip at bigskypenguin.com
Hey all,
Just joined the list so I'll preempt your
"welcomes" now:
Thank you, thanks, great to see you all. I'm here
all weekend at the Flamingo Lounge, enjoy the buffet.
Now here's my question. I'm using Scriptaculous to
create a pop up with the following class definition:
.popup_panel {
position: absolute;
text-align: left;
top: 100px;
left: 180px;
margin: 0 0 1px 0;
border: 2px solid #555;
z-index: 100;
background-color: #fff;
color: #999;
}
The HTML code used to create the template has an
id value of the same name:
...
Then in the javascript I try to adjust the
position of the pop up with the following
var xpos=e.pageX;
var ypos=e.pageY;
// set the position of the pop up in the browser.
var popup=document.getElementById('popup_panel');
popup.style.top=xpos-50;
popup.style.left=ypos-50;
It gets the pageX and pageY values fine (tested
with a call to alert function), but does not
adjust the popup's position beyond what is set in
the CSS.
Any help would be greatly appreciated.
--
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison, WI 53703
608-250-2720
http://bigskypenguin.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20080311/17e41abd/attachment.htm>
More information about the Javascript
mailing list