jQuery Pin It Button For Images
JQuery hook to manually call plugin? (6 posts)

  1. veevee
    Posted 1 year ago #

    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?


  2. Marcin Skrzypiec
    Plugin Author

    Posted 1 year ago #

    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).

  3. veevee
    Posted 1 year ago #

    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

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

    Posted 1 year ago #

    Good job!

  5. veevee
    Posted 1 year ago #

    ...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

  6. Marcin Skrzypiec
    Plugin Author

    Posted 1 year ago #

    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.


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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • jQuery Pin It Button For Images
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic