If you wish to use jQuery in your client’s website that requires BDP to have loaded before executing, you can use the onComplete() function. The following example uses onComplete() in conjunction with the sharrre jQuery plugin to allow social shares of the specific property the user is currently looking at.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
onComplete : function(){ $('#twitter').sharrre({ share: { twitter: true }, template: '<a class="box" href="#"><div class="count" href="#">{total}</div><div class="share"><span></span>Tweet</div></a>', enableHover: false, enableTracking: false, buttons: { twitter: {via: '_JulienH'}}, click: function(api, options){ api.openPopup('twitter'); api.simulateClick(); } }); $('#facebook').sharrre({ share: { facebook: true }, template: '<a class="box" href="#"><div class="count" href="#">{total}</div><div class="share"><span></span>Like</div></a>', enableHover: false, enableTracking: false, click: function(api, options){ api.simulateClick(); api.openPopup('facebook'); } }); $('#googleplus').sharrre({ share: { googlePlus: true }, template: '<a class="box" href="#"><div class="count" href="#">{total}</div><div class="share"><span></span>Google+</div></a>', enableHover: false, enableTracking: false, click: function(api, options){ api.simulateClick(); api.openPopup('googlePlus'); } }); |