Jump to content

Facebook likebox doesn't show up in opera


Recommended Posts

Hi,

I have a nice script for sliding likebox. On demo page it works perfectly in all browsers but when I place it on my page it works in Firefox, Chrome and IE but doesn't show up in Opera. (Nor on my prestashop site, nor on blank test-site). Do you have any ideas why?

 

Here is this script:

Header:

<script
  type="text/javascript"
  src="PATCH TO SCRIPT FILE"
  fbpage='cocacola'></script>

 

Script:

var FBSideLike = {};
FBSideLike.init = function() {

var scr = $$('script[fbpage]');

if (scr.length == 1) {
 scr = scr[0];
 var fbpage = scr.get('fbpage');
} else {
 return;
}
var border = scr.get('bordercolor') || '3b5997';
var image  = scr.get('image') || 'plain';
var base   = scr.get('src').replace('fb-sidelike.js', '');

var box = new Element('div', {
 id: 'fb-side-like',
 styles: {
  backgroundImage: 'url(' + base + 'fb-sidebar-' + image + '.png)',
  backgroundRepeat: 'no-repeat',
  position: 'fixed',
  top: '21%',
  right: -292,
  width: 322,
  height: 258
 }
}).inject(document.body);

var like = new Element('div', {
 styles: {
  position: 'absolute',
  left: 30,
  width: 292,
  height: 258,
  background: '#fff'
 }
}).inject(box);

var toggle = function(dir) {
 box.tween('right', dir < 0 ? -1 : -292);
}

like.set('html', '<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2F'
 + fbpage
 + '&width=292&height=258&colorscheme=light&show_faces=true&border_color=%23'
 + border
 + '&stream=false&header=false&appId=217935911592728"'
 + 'scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:258px;" allowTransparency="true"></iframe>');

box.set('tween', {
 duration: 550,
 transition: Fx.Transitions.Pow.easeInOut
}).addEvents({
 'mouseenter': function() { toggle(-1); },
 'mouseleave': function() { toggle(1); }
});
}
if (typeof(MooTools) == 'undefined') {
(function() {
 var mt = document.createElement("script");
 mt.type = "text/javascript";
 mt.src = ("https:" == document.location.protocol ? "https" : "http") + "://ajax.googleapis.com/ajax/libs/mootools/1.2.5/mootools-yui-compressed.js";
 mt.async = true;
 mt.onload = FBSideLike.init;
 var s = document.getElementsByTagName("script")[0];
 s.parentNode.insertBefore(mt, s);
})();
} else {
window.addEvent('load', FBSideLike.init);
}

Link to comment
Share on other sites

the problem might be related to the other scripts that you've got on your website

That's why I tested it also on newly created blank page (with only this script and nothing else) :)

 

Script can be seen on this page (there it works in all browsers including Opera)

http://www.monkeyphysics.com/articles/read/22/facebook_side_sliding_like_box.html

Edited by Palforpaws (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...