首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Sharrre和Whatsapp

Sharrre和Whatsapp
EN

Stack Overflow用户
提问于 2014-12-31 20:41:17
回答 1查看 941关注 0票数 1

尝试与Sharrre (http://sharrre.com/)一起使用"whatsapp“共享按钮。

到目前为止,主要的想法是:

当然,如果您愿意,请在您的手机上试用见示例

代码语言:javascript
复制
function shareme(shareElementMobile){
$(shareElementMobile).each(function (i) {
    var lnk = $(this).attr('data-url'),
        txt = $(this).attr('data-text'),
        resTxt = encodeURIComponent(txt),
        resLnk = encodeURIComponent(lnk);


    $(this).sharrre({
        share: {
            facebook: true,
            twitter: true,
            linkedin: true
        },
        template: '<ul class="box"><li><h2>{total}  <small>Compartido</small></h2></li><li id="facebook"><i class="fa fa-facebook"></i></li><li id="twitter"><i class="fa fa-twitter"></i></li><li id="linkedin"><i class="fa fa-linkedin"></i></li><li id="whatsapp"><a href="whatsapp://send?text=' + resTxt + ' ' + resLnk + '"><i class="fa fa-whatsapp"></i></a></li></ul>',
        enableHover: false,
        enableTracking: true,
        buttons: {
            facebook: {
                layout: 'button',
                send: true
            },
            twitter: {}
        },
        render: function (api, options) {

            $(api.element).on('click', '#twitter', function () {
                api.openPopup('twitter');
                return false;
            });

            $(api.element).on('click', '#facebook', function () {
                api.openPopup('facebook');
                return false;
            });

            $(api.element).on('click', '#linkedin', function () {
                api.openPopup('linkedin');
                return false;
            });

        }
    });


});
}

shareme('#sharemeMobile');

结果是whatsapp的按钮根本不工作。

我需要把每个社交按钮分开吗??

EN

回答 1

Stack Overflow用户

发布于 2015-01-08 23:12:48

我想出来了

我需要补充一句:

代码语言:javascript
复制
$(api.element).on('click', '#whatsapp', function () {
                api.openPopup('whatsapp');
                return false;
            });

现在一切都正常了。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27726145

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档