Closed (outdated)
Project:
Views Infinite Scroll
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Apr 2012 at 21:01 UTC
Updated:
3 Jul 2019 at 10:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bryancasler commentedGrammar correction and I also wanted to mention I'm using the current git snapshot, so all the D7 commits today have been included.
Comment #2
Remon commented@animelion,
I'm not sure if your using a contrib or a custom functionality to add googleplus button. Either way, it should be fine as long as your js code is wrapped in a Drupal js behavior that gets executed when Drupal.attachBehaviors() is called.
Views Infinite Scroll module calls Drupal.attachBehaviors on newly loaded content, i.e if you're js code, that is responsible for adding the button is actually a behavior, then everything should be fine.
Hope that helps.
Feel free to re-open if I'm not making myself clear enough.
Comment #3
bryancasler commentedHi Remon,
I tried several contrib modules that all resulted in the same effect I described above...
http://drupal.org/project/addthis
http://drupal.org/project/fb_social
http://drupal.org/project/sharethis
http://drupal.org/project/google_plusone
So then I decided to try a more direct approach. I inserted the button code directly via a Panel's "Custom Content" pane in the node teaser.
HTML
Javascript
This custom configuration is what you currently see on the live website. I'm not proficient enough with JS to figure out what I'm supposed to do with "Drupal.attachBehaviors". I've been googling around to see if I can find any clues, but any help would be greatly appreciated.
REF: #983738: Call Drupal.attachBehaviors() after a load of new content
REF: http://drupal.org/node/114774#javascript-behaviors
Comment #4
bryancasler commentedOk, thanks to help from mkadin in the #drupal-support IRC room I am now using this JS
The only problem remaining is that the Facebook buttons still don't load on infinite scroll. These changes are live and you can see them here. http://matttucker.onedogdevelopment.com/
Comment #5
bryancasler commentedAlright, I narrowed it down further. The reason for FB not loading has something to do with the code not being asynchronous . So I googled for "Facebook Like Button asynchronous " and got some jquery code (link: http://daily.siebler.eu/2011/04/facebook-like-button-asynchronous-loadin...). Spliced that suggestion in with my existing Facebook function and bam! everything works.
Working JS
The good news is that this solution also works with the LabJS module and core's JS Aggregation.
I don't think this issue is ready to be closed however. It would be great if we could figure out some solution/documentation for getting Views Infinite Scroll to work with these other social modules.
http://drupal.org/project/addthis
http://drupal.org/project/fb_social
http://drupal.org/project/sharethis
http://drupal.org/project/google_plusone
Comment #6
bryancasler commentedOk, this solution just stopped working for some unknown reason.
Comment #7
quickly commentedI am having a similar issue... I know it is not a bug in this module, I just cannot figure out the solution... It will be nice if someone could guide me..
I am using js for giving a grayscale to colored effect on mouse hover on images using the code on:
http://webdesignerwall.com/tutorials/html5-grayscale-image-hover
I have this file in my themes .info file. It is working fine everywhere but when I use it with infinite scroll only the images loaded on page load are effected by this js file... the ones that come on scrolling are not...
can anyone guide me... I know it has something to do with drupal behaviours... But I hae no idea about attaching a behavior and stuff... I have googled alot but nothing was quite understandable for me :S
I know it has a simple solution, I just cant figure it out :(
Comment #8
quickly commented#5 worked for me... Thanks @animelion
Comment #9
urlM commentedYou can asynchronously load the tweet button too if you add this function to animelion's js in #5:
Comment #10
quickly commentedI am using asynchronous loading for facebook, google+ and twitter as described in this post... In Firebug console I am seeing a separate call for every google+ and twitter widget. Is it normal or something is wrong? I am also using pinterest and facebook widgets but there is not any call in console for them (although they are working perfectly fine). I have attached the image.
Comment #11
Anonymous (not verified) commentedI messed around with this for a while. Save yourself some time and use the Facebook iFrame code. :-)
Comment #12
mahipal46 commentedadd code in your js file: addthis.toolbox('.addthis_toolbox');
Comment #13
shailu29 commentedFor google +
Drupal.behaviors.socialbuttons = {
attach: function(context, settings) {
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
}
};
For Twitter
jQuery(document).ajaxComplete(function () {
twttr.widgets.load();
});
For Facebook
jQuery(document).ajaxComplete(function () {
FB.XFBML.parse();
});
Comment #14
honza pobořil commented7.x-1.x will receive no work. Migrate to 7.x-2.x.