• Resolved gwinnie

    (@gwinnie)


    Greetings everybody! I have a bit of a Javascript newbie question.

    My site is a photo blog using Infinite Scroll version 2.0b2.110709 for seamless post loading. Additionally, I am using WP Facebook Like 1.5.1 and Google +1 1.0.4 for buttons after posts.

    Problem is, when Infinite Scroll loads more posts after user scrolls down, FB Like and G+1 buttons are no longer loaded after the posts. I presume that this could be addressed in an Infinite Scroll post-load Javascript. I’ve been trying to look at the buttons coding, but I still have no idea what JS functions to call to load the Like and +1 buttons for the additional posts.

    Thanks a bunch for any hints!

Viewing 15 replies - 1 through 15 (of 25 total)
  • Right so in the infinite-scroll options -> callback box you’ll need to call fblike and g+ again in order to re-run and pickup the new posts. So you’ll need to paste in something (exactly) like:

    window.fbAsyncInit = function()
    						{
    							FB.init({appId: 115079708540175, status: true, cookie: true, xfbml: true});
    						};
    						(function()
    						{
    							var e = document.createElement('script'); e.async = true;
    							e.src = document.location.protocol + '//connect.facebook.net/en_PI/all.js';
    							document.getElementById('fb-root').appendChild(e);
    						}());
    gapi.load('googleapis.client:plusone', window['__bsld'], null);

    Let me know if you have any questions ??

    Thread Starter gwinnie

    (@gwinnie)

    Amazing, sir! This does the trick. Wow, it would take me ages to find out on my own.

    Thank you very much indeed. ??

    Resolved, thank you bear!
    Arrr!

    ??

    Thanks for Facebook!

    And for Twitter??

    samroud, have you got an example of the twitter plugin working? (so then I can find what code to put in the callback)

    Hi beaver,

    g+ button in mysite is not working anymore and I cant figure why.

    p.s.
    debug mode is activated

    Thank u.

    @ant0nio, can you try replacing the following:
    gapi.load('googleapis.client:plusone', window['__bsld'], null);
    with:
    gapi.plusone.go();

    Let me know how it goes ??

    works! Thank you again!

    Xhynk

    (@alexdemchak)

    Somewhere built in my theme is a call a Fancybox script, which I need for my posts (4×4 grid of clickable pics)

    My Site

    When you scroll down, the images just load with the zoom thing over it, unclickable :/

    other than that, works great! I just wish my posts worked ??

    I’m not sure what to put in the ;load javascript; box :/

    Xhynk

    (@alexdemchak)

    Basically, I need to refresh my scripts etc. that execute in the footer, which calls to the page-templates.php and ultimately the fancybox javascript.

    How do I go about that?

    First you need to upgrade to the latest RC version for this to work:
    https://downloads.www.ads-software.com/plugin/infinite-scroll.2.0b.111218RC2.zip

    Just unzip, upload (and overwrite the existing plugin)

    After you’ll be wanting to put the following in the “javascript to be called after load” box:

    jQuery(newElements).fancybox({
    		'overlayOpacity'	:	0.7,
    		'overlayColor'		:	'#000000',
    		'transitionIn'		: 'elastic',
    		'transitionOut'		: 'elastic',
    		'easingIn'      	: 'easeOutBack',
    		'easingOut'     	: 'easeInBack',
    		'speedIn' 			: '700',
    		'centerOnScroll'	: true
    	});
    Xhynk

    (@alexdemchak)

    I.Love.You. No homo. ??
    It works like a charm! I’ve got a couple bugs to work out, but they are purely graphical and shouldn’t be hard to remedy.

    Thanks!!

    qsdnxu

    (@qsdnxu)

    Hi beaver6813!

    As i can see you are realy good at what you are doing ?? First of all thanks for helping others, secondly it works for me as weel, but i don’t understand how i could change the like button text to the default. because this apperars to me:

    ” Arr! Be th’ first of all ye matey’s to find this pleasin’ to yer eye. “

    I have alerady changed the appi code but nothing changed.
    Thanks a lot!

    qsdnxu

    (@qsdnxu)

    LOL It was a pirat languages LOL Ok now i find i just had to change the en_PI to en_US

    here:

    ‘//connect.facebook.net/en_US/all.js’;

    Thanks again! ??

    beaver6813

    (@beaver6813)

    Haha crazy, I think everyone should speak in Pirate language ??

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Infinite scroll vs. FB Like and G’ is closed to new replies.