javascript - Display Content After Google+1 Button Clicked -
i thought special content share content in social media great , started working on thing.
i managed working facebook likes , twitter tweets, stuck in google+1.
the information here didn't helped much: http://support.google.com/analytics/bin/answer.py?hl=en&answer=1366830
can tell me how register +1 , display content (hidden div) after +1?
here codes using:
html
<div class="g-plusone" data-size="medium" callback="cpg1callback"></div>
javascript
function cpg1callback(data){ if (data.state == 'on') { $('.gpsuccessmsg').show("blind", { direction: "vertical" }, 500); } }
i have placed js code in js file linked @ header , not working, tried placing js code before closing body tag no success. guidance here helpful.
regards
i got working @ last, after spending couple of hours. sharing might looking answers on same issue.
you need have callback (functionname) within callback
attribute in case of default +1 button markup make call work. example, +1 button code should be:
<g:plusone size="medium" callback="cpg1callback"></g:plusone>
in case of html5 valid syntax, attribute should data-callback
. example:
<div class="g-plusone" data-size="medium" data-callback="cpg1callback"></div>
i hope save time.
Comments
Post a Comment