context box not working as expected

Page: 1

Author Post
Member
Registered: Jun 2014
Posts: 8
Hello,
Iam using Floatbox 6.0.3 version. I want to load up dynamic content from server to the context box. My problem is I can't get the context window to open up at the click location and other prob is that the entire page is greying out. It behaves like a floatbox instead of fbContext ?

<a class="fbContext" href="#" onclick="fb.start('getContent.html')" >[1.2]</a>


Can you pl. suggest as to what Iam doing wrong?

Also, do you have any detailed example of using a context box ?

Thanks very much.

Priti
Administrator
Registered: Aug 2008
Posts: 3382
Please review the instructions for creating context boxes at http://floatboxjs.com/instructions#context. Note especially the requirement to have a data-fb-context attribute that contains at minimum a defined source option.

The API function fb.start starts a standard floatbox and has no place on an fbContext element.

Detailed examples of most Floatbox capabilities can be found on the demo page, with a couple of fbContext boxes under the Tooltips+ tab.
Member
Registered: Jun 2014
Posts: 8
Hi, still can't seem to make it work.

A brief here -- I want to get the DB value into the context box. I am using Spring MVC with Jquery/ajax.

I have this input in DB -

update discussion set
discussion_desc='second description
<div id=contextVal" style="display:none;">${valueFromDB}</div>
<a class="fbContext" onclick="populateValueForAboveDiv()"
href="#" data-fb-context="source:#contextVal">click this</a>'
where discussion_title='title 2';

But the context box does not seem to open. Also, can the source call the function in JS?

Thanks so much for your help and time.

Priti
Administrator
Registered: Aug 2008
Posts: 3382
I'd have to see the misbehaving context box live and in action to determine why it is not firing.

Check out the API reference for the afterBoxStart and afterItemStart callbacks, which are good ways to run javascript against freshly opened floatbox content.
Member
Registered: Jun 2014
Posts: 8
Ok, here's the simplest version I have, which is not working for me.


<form>

<div id="context1" style="display:none;">hello</div>
<a class="fbContext" href="#" data-fb-context="source:#context1">
click this</a>
</form>


Also, the below instruction page code, defies me...
<img class="fbContext" data-fb-context="source:#context1" src="pic1.jpg"/>

However this works for me, but its a floatbox and not what i want for my requirements..


<form>

<div id="context1" style="display:none;">hello</div>
<a class="floatbox" href="#" data-fb-options="source:#context1">
click this</a>
</form>


Any suggestions, plz ?
Administrator
Registered: Aug 2008
Posts: 3382
Sorry, but it's simply not possible for me to guess why the context box is not opening from looking at purported code snippets.

If you want me to determine the reason for the failure, you must link me to a live page that exhibits the problem, and tell me what to look for on that page.

Page: 1