Floatbox Positioning

Page: 1

Author Post
bobhendren
Guest
I've been going through the docs and the script files themselves, but can't seem to find this answer: Is there a way to specify the position of the Floatbox, rather than it just be centered on the screen or in the frame?

In most cases, I would want it centered, but I'd also like to be able to specify something like "center horizontally, put top 20 pixels from top of window/frame boundary". I'm not enough of a Javascript junkie to figure this one out...yet.
Administrator
Registered: Aug 2008
Posts: 3382
There's currently no placement mechanism other than the default centering, but I've been considering adding this capability. It gets complicated when you try to handle the effect that might have on autoSizing of content to fit the screen, but I suppose I could just ignore that - if someone pushes resized content off screen, it goes off screen.

Perhaps the way to implement this is with positionLeft and positionTop options. If they are plain numbers then they're taken to be raw pixel locations. If they are percentages then they are displacements of that amount of the available free screen area. So "positionLeft:-50%" would move the box half way over to the left edge from its default location.

I'm open to suggestions.
bobhendren
Guest
The positionLeft / positionTop is what I thought about, but I wasn't even thinking that complex. I thought if positionTop were anything other than false or empty string, place the floatbox X pixels from the top. So, if positionLeft remained default, it would center horizontally and be X pixels from top. The percentage positioning that you mentioned sounds too tough to figure out!

For my application, there are two types of implementations: standalone web sites and framing of my application into other third-party web sites. Because I don't control those third-party sites, I can't control positioning - so, I've seen some REALLY screwed up frame sizes with my content inside. With the default centering behavior, it can push the floatbox completely off-screen now. If I could simply designate to position X pixels from top or left of FRAME/IFRAME, then it would at least be partially visible to the end-user.

Page: 1