You just want some code to start working, the following markup will allow interaction events in the +1 button:
<div class="g-plusone" data-expandto="bottom" data-onendinteraction="onEnded" data-onstartinteraction="onStarted" data-recommendations="false" data-annotation="inline" data-height="25" data-autoclose="true" data-callback="onCallback" data-width="300" >
The following code will handle events:
function onStarted(args){ console.log("started"); console.log(args); } function onEnded(args){ console.log("ended"); console.log(args); } function onCallback(args){ console.log("callback"); console.log(args); }
The callback returns the +1 state of the button, the start / end of the interaction indicates the state of the user. You can see a demo of all the events here .
class source share