Snippets

Fancybox addthis Resolved

Snippet allows you to share each image by adding the ‘addthis’ share function to your ‘Fancybox’ / ‘Fancyapp’ gallery instead of just having to share the page.

Its really easy to tweak and change icons aslong as you have ( href=”‘ + this.href + ‘” addthis:url=”‘ + this.href + ‘” addthis:title=”‘ + this.title + ‘” ) within the ‘a link’ it’ll work.

Good luck and enjoy.

$(".fancybox").fancybox({
    beforeShow : function() {
        this.title = '<div class="addthis addthis_default_style "><a href="' + this.href + '" addthis:url="' + this.href + '" addthis:title="' + this.title + '" class="addthis_button_preferred_1"></a><a href="' + this.href + '" addthis:url="' + this.href + '" addthis:title="' + this.title + '" class="addthis_button_preferred_2"></a><a href="' + this.href + '" addthis:url="' + this.href + '" addthis:title="' + this.title + '" class="addthis_button_preferred_3"></a><a href="' + this.href + '" addthis:url="' + this.href + '" addthis:title="' + this.title + '" class="addthis_button_preferred_4"></a><a href="' + this.href + '" addthis:url="' + this.href + '" addthis:title="' + this.title + '" class="addthis_button_compact"></a><a href="' + this.href + '" addthis:url="' + this.href + '" addthis:title="' + this.title + '" class="addthis_counter addthis_bubble_style"></a></div>';
    },
    afterShow : function() {
         addthis.toolbox(
            $(".addthis").get()
        );
        addthis.counter(
            $(".addthis_counter").get()
        );

    },
    helpers : {
        title : {
            type : 'inside'
        }   
    }
	});

Source: http://www.media21a.co.uk/themes/muddywater4x4/?page_id=36...

Share this snippet

 

Comments (1) - Leave yours

Leave a Reply

Your email address will not be published. Required fields are marked *

Please respect the following rules: No advertising, no spam, no keyword in name field. Thank you!