This is the demonstrations page for the jquery.twitterbutton.js jQuery twitter button plugin
Download jquery.twitterbutton.js
<div id="twitterbutton-example"></div>
<script type="text/javascript" src="js/jquery.twitterbutton.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#twitterbutton-example').twitterbutton();
});
</script>
<div class="twitterbutton-content" style="display:none;font-size:120%;color:#336633;">Thank you for liking!</div>
<div class="twitterbutton-uncontent" style="display:none;font-size:120%;color:#f00;">Hey! What's wrong? Why did you unlike this content?</div>
<div id="twitterbutton-example"></div>
<div class="twitterbutton-content remember-state" style="display:none;">...your content here...</div>
<script type="text/javascript" src="js/jquery.twitterbutton.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#twitterbutton-example').twitterbutton({
user:'YourUsername',
title:'jQuery-Twitter-Button Plugin with callback functions',
onfollow:function(response){
$('.twitterbutton-uncontent:visible').hide('fade');
$('.twitterbutton-content').show('fade');
$.cookie('tw','followed');
},
ontweet:function(response){
$('.twitterbutton-uncontent:visible').hide('fade');
$('.twitterbutton-content').show('fade');
$.cookie('tw','tweeted');
},
onretweet:function(response){
$('.twitterbutton-uncontent:visible').hide('fade');
$('.twitterbutton-content').show('fade');
$.cookie('tw','retweeted');
},
lang:'en'
});
if($.cookie('liked')=='liked'){$('.remember-state').show('fade');$('.twitterbutton-uncontent:visible').hide('fade');}
});
</script>
<div id="twitterbutton-example"></div>
<script type="text/javascript" src="js/jquery.twitterbutton.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#twitterbutton-example').twitterbutton({
user: 'YourUsername',
user_description: 'Some additional text describing the user',
url: 'http://www.not-the-url-the-button-is-on.com',
count_url: 'http://www.a-differing-url-from-the-tweeted-one.com',
title: 'Different from the document title',
mode: 'insert',
layout: 'vertical', //vertical|horizontal|none
action: 'tweet', //tweet|follow
lang: 'en', //en|de|ja|fr|es
hideafterlike:false,
googleanalytics:false, //true|false
googleanalytics_obj: 'pageTracker', //pageTracker|_gaq
ontweet: function(){return true;},
onretweet: function(){return true;},
onfollow: function(){return true;}
});
});
</script>
Check out the Google +1 button plugin and the Facebook Like button plugin as well
Social Media Automat powered by nexecutive