Firing Context Box

Page: 1

Author Post
Member
Registered: Apr 2009
Posts: 56
What is the function name to fire Context Boxes in your script?

Can it be called similar to fb.start()? Perhaps like this: fb.context()? (BTW, I tried that.)

I want to fire a Context box from a Flash button instead of an HTML href link or an <img> tag. I would like to trigger a function in the <head> that lights up a context box , or perhaps just trigger it directly (and more efficiently) in the Floatbox script. Thus, avoiding the step of writing a function in the <head>.

As a sidebar, I'm feeding classes, options and attributes dynamically with XML to the Flash button. Everything works great with fb.start() included in the XML document. Is it possible with Context boxes?

If not, don't sweat it.

PS. I really, really, really, really like your context boxes. Since you added them a few months ago, I've been blowing large bubble gum balloons while coding. It makes it so fun and surfing for specific info is so darn quick for website visitors. You can light up product information and other tid-bits and let people get-in and get-out quick with no drama. I think I mentioned this before. If I didn't, I have now.
Administrator
Registered: Aug 2008
Posts: 3382
A context box is just a floatbox with particular options set and some mouse/touch handlers added to the host element. In fact, the Floatbox code launches all context boxes with a call to fb.start() - no separate API function required.

A call to open a pseudo context box might look like this:
fb.start(&#039;#sourceDivId&#039;, {
modal: false,
doAnimations: false,
boxLeft: &#039;click&#039;,
boxTop: &#039;click&#039;,
centerOnResize: false,
colorTheme: &#039;white&#039;,
enableDragMove: false,
enableDragResize: false,
innerBorder: 0,
outerBorder: 1,
padding: 0,
roundCorners: &#039;none&#039;,
scrolling: &#039;no&#039;,
shadowSize: 8,
shadowType: &#039;hybrid&#039;,
showClose: false,
showOuterClose: false
});

(If you're an astute reader of the Floatbox documentation, you'll probably twig that it would be better to assign these options to a reusable classOptions definition in options.js and then use a simpler start call of fb.start('#sourceDivId', 'className:myNewClassName');)

So that takes care of what it looks like and how to start the damn thing, but there's not much in there that integrates mouse/touch actions. The host node actions are irrelevant because there is no host node. But in particular what is missing from this is the behaviour of closing the context box if something outside of the box is clicked. If you want that outside click behaviour, set modal:true, outsideClickCloses:true and overlayOpacity:0
Member
Registered: Apr 2009
Posts: 56
Sir Floatbox,

(or should that be Lord Floatbox? :mrgreen: )

The context boxes ignite under all scenarios. I'm using them to light-up an "info" caption and some Flash buttons. The "info" scenario presents itself pretty darn well - quick and fast.

Everything works like a treat.
If you want some, I have a large blob of frustrated and gnawed Texas bubble gum sticking to my desk. It's lacking some flavor, but still has life. I mean gee whiz, those fancy context boxes are executed through options and not a function call. Simple as that? I guess my keyboard was thinking too far outside "your box".

Time for a fresh dip of snuff. :shock:
Willing to share.

Seriously, thank you so much. It works great!
Administrator
Registered: Aug 2008
Posts: 3382
Some just call me Mr. Floatie.

Page: 1