Working with facebook Javascript-SDK (loaded from its servers asyncronously) gives a strange effect:
after successfully login to FB via SDK the FB-Logout-Button is moving pixelwise from right to left and back.
The login/logout-button is declared as:
<fb:login-button size="large" autologoutlink="true" perms="email,user_birthday,status_update,publish_stream"></fb:login-button>
stopping the script in Firebug results in a javascript-file called M6XESwM2V2D.js and there in the following code lines:
__d("PluginResize",["Log","UnverifiedXD","bind","copyProperties","curry"],function(a,b,c,d,e,f){var g=b('Log'),h=b('UnverifiedXD'),i=b('bind'),j=b('copyProperties'),k=b('curry');function l(o){o=o||document.body;return o.offsetWidth+o.offsetLeft;}function m(o){o=o||document.body;return o.offsetHeight+o.offsetTop;}function n(o,p,event){this.calcWidth=o||l;this.calcHeight=p||m;this.width=undefined;this.height=undefined;this.event=event||'resize';}j(n.prototype,{resize:function(){var o=this.calcWidth(),p=this.calcHeight();if(o!==this.width||p!==this.height){g.debug('Resizing Plugin: (%s, %s, %s)',o,p,this.event);this.width=o;this.height=p;h.send({type:this.event,width:o,height:p});}return this;},auto:function(o){setInterval(i(this,this.resize),o||250);return this;}});n.auto=function(o,p,event){return new n(k(l,o),k(m,o),event).resize().auto(p);};e.exports=n;});
When halting the code in javascript-debugger, the button movement stops (as expected), and proceeding the code moves it on. In the above printed javascript-Code there is a call to the setInterval-Method. So, this could explain the behaviour. But why do they do something like this?
How can i stop this effect?
Btw - adding style="position:fixed;" to the login-button helped me:
Cheers, KT.
I'm actually getting the same issue on my website. It appears to be a bug with facebook. I've raised it as a bug at:
https://developers.facebook.com/bugs/302726826490772