Forum Moderators: open

Message Too Old, No Replies

frameless "popup" entirley contained in browser window

         

cmose

6:01 am on Mar 31, 2007 (gmt 0)

10+ Year Member



Sorry for the poor title - I'd search more but I can't seem to figure out exactly what to call what I'm looking for. Basically I'm trying to create a pop up window but not a separate window, e.g., just a div that will show up on the center of the browser window, fully contained within the browser window.

I could figure this out if it were just based off of clicking on a link but I'm attempting to use this as a loading "popup" (incorrect term in my mind) for an ajax request. Buggered if I can think of an example off the top of my head, but the idea is something like those god awful annoying,borderless ads that pop up and stay centered in your browser until you close them.

I'd appreciate direction here, despite my entirely inadequate attempt to describe what I'm looking for. Thanks much

RonPK

1:08 pm on Mar 31, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hehe, well spoken, cmose :)

Basically you need to manipulate the

display
and
top
and
left
properties of an absolutely positioned DIV present in the page's HTML. Switch the value of the display property from
none
to
block
, and top and left to whatever values are required to center the DIV in the viewport.

Positioning the DIV is usually the hard part as you'll need to deal with browser peculiarities, and with scrolling. It also matters whether the page is rendered in quirks mode or in standards compliant mode.