How to adjust position of FB.ui stream publish dialog box
I m using FB.ui method in facebook to show stream publish box as follows:
function showfeed()
{
var publish = {
method: 'stream.publish',
attachment: {
name: 'XYZ',
caption: 'caption here',
description: ('description'),
href: 'url',
media: [{
type: 'image',
href: 'url',
src: 'xyz.gif'
}]
},
action_links: [{ text: 'XYZ', href: 'url' }]
};
FB.ui(publish,null);
}
This works fine but my page is very long in height so when i click button to show this dialog it appears at center of page not at开发者_开发百科 top so even dialog is display at center it's not display to me as i m at top. Is there any away to position dialog at top so any one can see it.
add the code below to <style>
. [got that from other forums) hope that helps
div.fb_dialog_advanced+div.fb_dialog_advanced {
top:50px !important;
}
div.fb_dialog_advanced+div.fb_dialog_advanced { top:50px !important; }
does not work any longer. See this:
1:
But I've worked around the issue with jQuery. It's kinda hacky but it works:
function move_to_top( value )
{
$(".fb_dialog").each(function(index) {
if($(this).css("top")!='-10000px') {
$(this).css("top", value + 'px' );
}
});
setTimeout( ('move_to_top("'+value+'");'), 1250);
}
function send_request()
{
FB.Canvas.scrollTo(0,0);
FB.ui({method: 'apprequests', message: 'Press accept to see this request.', data: 'tracking information for the user'},
function(response) {
if(response!=null)
{
alert('You are boss')
}
});
$(".fbProfileBrowserResult").ready( function(){
t = setTimeout ( ('move_to_top("'+50+'")'), 1250 );
});
}
精彩评论