tmort / Socialite

Other
1.68k stars 164 forks source link

Multiple social containers #103

Open b1nary opened 9 years ago

b1nary commented 9 years ago

As i can define the social container i assumed that it would be possible to have multiple different buttons of the same kind on the same page.

My scenario is, i have a single page application. There is a facebook like and a twitter share on the start page (for the startpage). You can dynamically generate images which results in a popup which again should have a twitter share, facebook like and even more but this time specified for the specific image with specific text fitting to the image.

I tried several variations of these:

$(".form-social .item a, .form-social .item div").attr('data-href', uri)
$(".form-social .item a, .form-social .item div").attr('data-url',  uri)

Socialite.load($(".form-social"));
Socialite.activate($(".form-social .facebook a"), 'facebook-like');
Socialite.activate($(".form-social .twitter a"),  'twitter-share');

But nothing is able to "re create" the specific social buttons.

Even worse, when i call:

Socialite.load($(".social-buttons"));

on page load, all the social buttons from ".form-social" get loaded as well, while none of them is contained in the other.

Currently i am pretty much stuck, wondering if this is even supposed to be possible.