kni-labs / rrssb

:arrow_right_hook: Ridiculously Responsive Social Sharing Buttons
https://rrssb.netlify.com/
MIT License
3.4k stars 423 forks source link

Buttons on ajax content #184

Closed xtianus closed 7 years ago

xtianus commented 8 years ago

I'd like to show the share buttons on an ajax-loaded modal. The modal is of course loaded after rrssb has been initialized on the main page, so the buttons don't behave well. I tried calling rrssbInit() in the ajax modal but it's not enough. This is the result:

image

dbox commented 8 years ago

Can you provide a demo / minimal working example?

xtianus commented 8 years ago

Can't give you a demo right now buy I can tell you what I did to make it work:

Now I can call "rrssbInit();" whenever I need to initialize the buttons. For example after a bootstrap modal has opened:

                $('#ajaxModal').on('shown.bs.modal', function (e) {
                    rrssbInit();
                });
dbox commented 7 years ago

Let me know if you can post a demo and we'll reopen.