尝试与Sharrre (http://sharrre.com/)一起使用"whatsapp“共享按钮。
到目前为止,主要的想法是:
当然,如果您愿意,请在您的手机上试用见示例。
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的按钮根本不工作。
我需要把每个社交按钮分开吗??
发布于 2015-01-08 23:12:48
我想出来了
我需要补充一句:
$(api.element).on('click', '#whatsapp', function () {
api.openPopup('whatsapp');
return false;
});现在一切都正常了。
https://stackoverflow.com/questions/27726145
复制相似问题