• I’m using another plugin to dynamically load content after the “Read More” link with json. My problem is that images loaded in that dynamic content do not get the pin-it button.
    I would guess that this is because the pin it plugin is called when the page is loaded, and any content loaded after that is not getting run through the pin it scripts.
    My json plugin has events that I can hook into when the dynamic content is loaded. I didn’t see a way to manually call the pin it plugin in your documentation.
    Does one exist?
    Thanks!

    http://wordpress.org/plugins/jquery-pin-it-button-for-images/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author mrsztuczkens

    (@mrsztuczkens)

    Unfortunately, for now, a way to manually call the plugin doesn’t exist. If there will be more requests like this one, I will consider adding it (it would require some changes in the plugin’s code).

    Thread Starter veevee

    (@veevee)

    Resolved.
    I created a jQuery function to encapsulate the pin-it plugin’s setup and bound that function to the events I needed as well as document.ready. It seems like it would be too much to bind that to a generic event so that the plugin could be recalled whenever.
    That way I wouldn’t need to avoid updates too 🙂

    Changes on lines 1-16 of script.js

    ;(function($){
    	"use strict";
    
    	var jpibfi_debug = false;
    
    	$(document).ready( function() {
    		jPinit();
    		$('.post').bind('RMRHContentExpanded RMRHContentCollapsed',function(e,data)
    		   {
    		     jPinit();
    		       // return false; // prevents event from bubbling up the DOM
    		   });
    		});
    		function jPinit(){
    		var settings = {
    			pageUrl        		: document.URL,
    Plugin Author mrsztuczkens

    (@mrsztuczkens)

    Good job!

    Thread Starter veevee

    (@veevee)

    …Kind of…
    After calling the plugin a second time, the pin it button sometimes flickers when you hover over it. I’m guessing it has something to do with the mousein/mouseout set Intervals. I tried removing all instances of the button when calling the plugin a second time and then replacing them (like what you worked out for window resize). But that doesn’t seem to have any effect. Still trying to figure that out, I made a work around that’s basically just a slow animation out before the button gets removed, but I’ll need to find something to fix that flicker. Let me know if you have any ideas? Thanks

    Plugin Author mrsztuczkens

    (@mrsztuczkens)

    Hi again,

    currently I’m working on refactoring JavaScript code to make things like adding images manually work. I’m not ready yet with a new version of the plugin to include those changes, but if you want, you can download the current version here: http://downloads.wordpress.org/plugin/jquery-pin-it-button-for-images.zip (it’s a development version, not 100% tested).

    I tested it on Twenty Twelve theme using Jetpack’s infinite scroll function and it works just fine. Here’s the code that’s needed for the Twenty Twelve and Jetpack pair to make it work.

    http://pastebin.com/n4fbDhKt

    Also, take a look at the document.ready code of the plugin itself, it might help you. Let me know if it helped.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘JQuery hook to manually call plugin?’ is closed to new replies.