2014年3月21日金曜日

Twitter ボタン Google+ ボタン

Twitter ボタン


ウェブサイトにボタンを追加してウェブサイトの訪問者がコンテンツを共有したり、あなたとTwitterでつながったりできるようにしましょう。

https://about.twitter.com/ja/resources/buttons#tweet

<a href="https://twitter.com/share" class="twitter-share-button" data-text="ツイッター本文" data-lang="ja" data-count="none" data-dnt="true">ツイート</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>




Google+ ボタン


ページに共有ボタンを含めるには、必要な JavaScript を含め、共有タグを追加する方法が最も簡単です。この基本的な実装には、幅を変更できる標準の 20 px 共有ボタンが含まれます。

https://developers.google.com/+/web/share/?hl=ja

<script src="https://apis.google.com/js/plusone.js"></script>
<g:plus action="share"></g:plus>


Google+ 共有リンク


共有リンクは、ネイティブ クライアント アプリケーション、Flash アプリケーション、プライバシーが重要なサイト、+1 ボタンまたは共有ボタンを使用できないその他のユーザー向けに作られています。次のマークアップをサイトに追加すると、訪問者に共有ダイアログをポップアップ表示するシンプルなアイコンが追加されます。

<a href="https://plus.google.com/share?url={URL}" onclick="javascript:window.open(this.href,
  '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img
  src="https://www.gstatic.com/images/icons/gplus-64.png" alt="Share on Google+"/></a>










0 件のコメント: