[Javascript] Changin pop up location?

Skip Evans skip at bigskypenguin.com
Wed Mar 12 09:41:21 CDT 2008


Hey Peter & all,

Yup! That did it. I don't know I missed that since 
I did use +'px' for the width!!!

D'oh!!!

Thanks much!
Skip

Peter Brunone wrote:
> 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.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Javascript mailing list
> Javascript at lists.evolt.org
> http://lists.evolt.org/mailman/listinfo/javascript

-- 
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison, WI 53703
608-250-2720
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and versatile
PHP/MySQL, AJAX & DHTML development framework.
http://phpenguin.bigskypenguin.com/



More information about the Javascript mailing list