Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Share Popup
- share = (function () {
- function popup(container) {
- var share,
- winWidth = (screen.width / 2),
- winHeight = (screen.height / 2),
- winTop = (screen.height / 2) - (winHeight / 2),
- winLeft = (screen.width / 2) - (winWidth / 2);
- $('.icons', container).on('click', function () {
- if ($(this).hasClass('icon__fbk')) {
- share = 'https://facebook.com/sharer.php?u=' + $(this).data('url');
- }
- if ($(this).hasClass('icon__twt')) {
- share = 'https://twitter.com/intent/tweet?text=' + $(this).data('text') + '&via=' + $(this).data('via') + '&url=' + $(this).data('url');
- }
- if ($(this).hasClass('icon__gpl')) {
- share = 'https://plus.google.com/share?url=' + $(this).data('url');
- }
- window.open(share, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
- return false;
- });
- }
- return {
- popup: popup
- };
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement