jQuery Pin It Button For Images
Fancybox Support (5 posts)

  1. mobe
    Posted 3 years ago #

    I want to use this plugin with fancybox lightbox script. The Full images in the fancybox lightbox have the CSS Class "fancybox-image".

    I tried using image selector -> img and Enabled classes -> fanxybox-image but I don't get the Pin it Button in the Full Image Fancybox View.

    Any solution?


  2. Marcin Skrzypiec
    Plugin Author

    Posted 3 years ago #

    To be honest, for now there isn't any solution for your problem in the plugin itself. The image (img tag to be precise) in the lightbox doesn't exist when the site is loaded (it's created dynamically once you click the image), therefore jQuery selector can't catch it when the page is loading.

    I will take a look at this issue in more detail and maybe I'll figure out a solution in one of the next versions of the plugin, but for now, there isn't anything you can do about it. Sorry.

  3. mobe
    Posted 3 years ago #

    thanks for the quick reply. Too bad to hear there is no solution at the moment. Hope you find a way to use this plugin with fancybox.

    For now, I use the regular pin button below the image in the fancybox description based on this snippets:

    I came up with this:

            beforeShow: function () {
                if (this.title) {
    				// Add Pinterest button
    				this.title = '<a id="pinbutton" data-pin-config="beside" href="//pinterest.com/pin/create/button/?url=' + document.location.href + '&media=' + this.href + '&description=via myDomain.com" data-pin-do="buttonPin" target="_blank" ><img src="//assets.pinterest.com/images/pidgets/pin_it_button.png" /></a><br />' + this.title ;
            afterShow: function() {
    			// Render pin button
    			var element = document.getElementById('pinbutton');
    			(function(x){ for (var n in x) if (n.indexOf('PIN_')==0) return x[n]; return null; })(window).f.render.buttonPin(element);
            helpers : {
                title : {
                    type: 'inside'

    Perhaps it gives you some inspiration, as the pin button gets rendered explicit this way, too.

  4. Marcin Skrzypiec
    Plugin Author

    Posted 3 years ago #

    Thanks, I'll look into that.

  5. scottgale
    Posted 2 years ago #

    Hey Guys, I wrote a tutorial on the JS way of doing this. You could just drop some JS into where you need to edit. Here is an example of how to do it if you're still stuck: http://scottgale.com/using-pinterest-with-fancybox/2012/08/15/

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