× Joomla Facebook Connect support forum

Topic-icon Setsize Variable

Active Subscriptions:

None
14 years 6 months ago #15478 by andbal
Setsize Variable was created by andbal
Hi - I am wondering how to use the setsize variable. I need to manually set heights for all of the pages over 800px, and I am pulling my hair out trying to read and comprehend facebook's documentation. Can you give me a the total noobs step-by-step intructions?

Thanks in advance.
The topic has been locked.
Support Specialist
14 years 6 months ago #15479 by alzander
Replied by alzander on topic Setsize Variable
You talking about when you're showing your page in a canvas, correct?

The syntax is pretty easy: FB.Canvas.setSize({ width: 640, height: 480 }); However, that must be caused after JFBConnect initializes the Facebook library, which is probably where you're running into issues. The below code should hopefully straighten you out:
window.addEvent('domready',function(e) {
   setTimeout("FB.Canvas.setSize({height:9000})",3000);
});
The first line is saying "Do this after the page has fully loaded", which is also when the Facebook Library gets initialized. You want to be 'after' that initialization, which is why we use the setTimeout function to delay the calling of the setSize by 3s (3000ms). The 3s is probably overkill, but get that working first, then decrease it to something like 500 (.5s).

Finally, with all that said.. what are you trying to do? JFBConnect does call the setAutoGrow/setAutoResize call, which will grow the page.. but unfortunately, that call will never shrink the page.. which is a good reason for wanting to do what you're looking for above. Just want to make sure you're doing the right thing for the right problem.

Hope that helps,
Alex
The topic has been locked.