setting fbPageOptions at runtime?

Page: 1

Author Post
Member
Registered: May 2012
Posts: 13
Howdy,

Is it possible to assign fbPageOptions such as the afterResize event when a user clicks on a link...something like this:

jQuery(window).load(function()
$("#myLink").click(function()
{
fbPageOptions = { afterResize: function() { showMessage(); }};
showVideo();
})
});


function showVideo()
{
// code to hide a div
// code to show a div
fb.resize(0);
}

function showMessage()
{
alert("afterResize event has fired");
}



I'm trying to do something very similar and i'm not getting the alert message being called from the afterResize event firing.

Any suggestions or is this just not possible?

best regards,

rise4peace
Administrator
Registered: Aug 2008
Posts: 3382
fbPageOptions is captured at page load time when the floatbox.js file is loaded. It's not queried again after that, so any changes to it will go unnoticed.

But I'm not sure you want to send it through fbPageOptions anyway. The callbacks are options just like all the others and can be specified anywhere that the other "normal" options can.

For example, if you're starting the video in a floatbox with the fb.start function, it might look like:
fb.start('myVideo.swf', {
width:480,
height:384,
afterResize: showMessage
});

Or... starting from an activated link:
<a href="myVideo.swf" data-fb-options="width:480 height:384 afterResize:showMessage()">go</a>

Page: 1