Forum Moderators: open
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
Basically you need to manipulate the
displayand
topand
leftproperties of an absolutely positioned DIV present in the page's HTML. Switch the value of the display property from
noneto
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.