• About
  • Policy
  • Contact

Phan Anh Buổi Sáng

  • Home
  • Kiến thức IT
    • PSD
    • Blogger
  • Translate
Google
Custom Search
Trang chủ » Blogger » [ Blogger ] Hướng Dẫn Thêm Button Vào Blogspot

[ Blogger ] Hướng Dẫn Thêm Button Vào Blogspot

Unknown Labels: Blogger Leave A Comment 00:54

Bước 1 : Đầu tiên, bạn cần thêm thư viện jQuery vào blog bằng cách thêm đoạn sau vào phía dưới thẻ<head>
1
<script src='http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'/>
Nếu bạn nào đã từng thêm thư viện jQuery vào blog rồi thì có thể bỏ qua bước này
Bước 2 : Tiếp theo, hãy thêm đoạn code dưới đây vào phía trên thẻ đóng </body>
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<script type='text/javascript'>
  //<![CDATA[
  /* Facebook */
  (function(d, s, id){
       var js, fjs = d.getElementsByTagName(s)[0];
       if (d.getElementById(id)) {return;}
       js = d.createElement(s); js.id = id;
       js.src = "//connect.facebook.net/en_US/all.js";
       fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
  window.fbAsyncInit = function() {
      // init the FB JS SDK
      FB.init({
        status     : true,                            
        xfbml      : true                              
      });
      FB.Event.subscribe('edge.create', function(href, widget) {
          $.event.trigger({
              type: "pageShared",
              url: href
          });
      });
  };
  /* Twitter */
    window.twttr = (function (d,s,id) {
    var t, js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
    js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
    return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
  }(document, "script", "twitter-wjs"));
  twttr.ready(function (twttr) {
      twttr.events.bind('tweet', function (event) {
          $.event.trigger({
              type: "pageShared",
              url: event.target.baseURI
          });
      });
  });
  /* Google Plus */
  (function() {
      var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
      po.src = 'https://apis.google.com/js/plusone.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
  function plusOned(obj){
      console.log(obj);
      $.event.trigger({
          type: "pageShared",
          url: obj.href
      });
  }
  /* Listen for the pageShared event */
  $(document).on('pageShared',function(e){
      if(e.url == window.location.href){
          $(".hide").show();
          $(".show").hide();
      }
  });
  //]]>
</script>
Bước 3 : Thêm đoạn code dưới đây vào phía trên thẻ  ]]></b:skin>
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
.hide {
  display: none;
  background: #f9f9f9;
  color: #111;
  border-radius: 5px;
  border-bottom: 4px solid #f1f1f1;
  padding: 20px;
}
.show {
  padding: 20px;
  background: #f9f9f9;
  color: #111;
  border-radius: 5px;
  border-bottom: 4px solid #f1f1f1;
  text-align: center;
 
}
.show .fb-like {
  margin-top: 0;
  top: -7px;
  position: relative;
}
.show .twitter-share-button {
  margin-right: 25px;
}

Làm sao để sử dụng ?

Để thêm button “Like to Unlock” vào bài viết, đầu tiên hãy chuyển sang chế độ soạn thảo HTML
1
Tiếp đó, điền đoạn code dưới đây vào vị trí muốn sử dụng
1
2
3
4
5
6
7
<div class="hide">
..........
</div>
<div class="show">
To unlock the content, use one of the social buttons below. Thank you for your support and love.
<span class="fb-like" data-layout="button_count" data-send="false" data-show-faces="false" data-width="90" expr:data-href="data:post.url" style="margin-right: 25px;"></span><a class="twitter-share-button" data-count="horizontal" data-related="" data-via="doiguocmoc"
    expr:data-text="data:post.title" expr:data-url="data:post.url" href="http://twitter.com/share">Tweet</a><span class="g-plusone" data-callback="plusOned" data-count="true" data-size="medium" expr:data-href="data:post.url"></span></div>
trong đó : …….. là phần nội dung sẽ bị ẩn đi
Cuối cùng, hãy xuất bản bài viết. Bây giờ, để xem phần nội dung bị ẩn đi, người dùng sẽ buộc phải like, twitter, +1 bài viết của bạn.
Chúc các bạn thành công

Bài viết liên quan

← Bài đăng mới hơn Bài đăng cũ hơn → Trang chủ
Powered by Blogger.

Các Bình Luận Gần Đây

Bài đăng phổ biến

  • Backdoor Scanner
    Code: <?php /* ################################################################################# # [+] File Name : Devilzc0de Backdoor Sc...
  • Tổng Hợp Thần Chú RIP 13 14 T - Zoy Thủ Thuật #Zoy
    1。我是孩子的父亲。我的孩子已经被宣布错了比她的实际年龄为Facebook的注册和我确定孩子,不要老使用Facebook,所以我要求的Facebook小组删除该帐户作为Facebook的方面出发, - 谢谢你的Facebook团队 因为宝宝已经使用Photoshop中制作假身份...
  • Share CMND Nữ Cho Anh Em Để Unlock & Report
    COPYRIGHT : MINH HAKU IT                                               
  • [PSD] Hacker - Đặng Khắc ĐứcPSD
    Demo Click here Download Click here
  • Code Admin finder
    Code: <title>Neutralised- Admin Finder</title> <form action="" method="post"> <p class="frontb...
  • [Dịch Vụ] Bán Blog Star Dũ IT ( WWW.StarDuIT.Com )
    Bán Blog Star Dũ IT (  WWW.StarDuIT.Com  ) Tổng Cộng Lượt View Là 61k ( Như Hình ) Giá Ra Đi Blog Là 200k ( Còn Fix Giá ) Đại Gia Nào Ưng Ý ...
  • Vua Sư Tử - The Lion King Gifs
    Vua sư tử là một phim hoạt hình thứ 32 của hãng hoạt hình Walt Disney vào năm 1994.
  • [SHARE] TUT xóa thông tin tài khoản garena 2016 - Zoy Thủ Thuật #Zoy
    Hello mọi người , Mình là Ken ! Hôm nay mình sẽ chia sẽ cho các bạn 1 thủ thuật cực mới, cách để xóa thông tin garena 1 cách cực kì nhanh ch...
  • Hướng dẫn hack game rắn ăn mồi Slither.Io trên máy tính 2016 - Zoy Thủ Thuật #Zoy
    Hướng dẫn hack game rắn ăn mồi Slither.Io trên máy tính với Tampermonkey . Bản hack bao gồm: hack zoom, hack tự xoay tròn, hack tự động chơi...
  • Bandicam Full Crack - Duy Ripper
     

Pageviews from the past week

Chuyên mục

Bài đăng phổ biến

  • Backdoor Scanner
    Code: <?php /* ################################################################################# # [+] File Name : Devilzc0de Backdoor Sc...
  • Tổng Hợp Thần Chú RIP 13 14 T - Zoy Thủ Thuật #Zoy
    Tổng Hợp Thần Chú RIP 13 14 T - Zoy Thủ Thuật #Zoy
    1。我是孩子的父亲。我的孩子已经被宣布错了比她的实际年龄为Facebook的注册和我确定孩子,不要老使用Facebook,所以我要求的Facebook小组删除该帐户作为Facebook的方面出发, - 谢谢你的Facebook团队 因为宝宝已经使用Photoshop中制作假身份...
  • Share CMND Nữ Cho Anh Em Để Unlock & Report
    Share CMND Nữ Cho Anh Em Để Unlock & Report
    COPYRIGHT : MINH HAKU IT                                               
  • [PSD] Hacker - Đặng Khắc ĐứcPSD
    [PSD] Hacker - Đặng Khắc ĐứcPSD
    Demo Click here Download Click here
  • Code Admin finder
    Code: <title>Neutralised- Admin Finder</title> <form action="" method="post"> <p class="frontb...
  • [Dịch Vụ] Bán Blog Star Dũ IT ( WWW.StarDuIT.Com )
    [Dịch Vụ] Bán Blog Star Dũ IT ( WWW.StarDuIT.Com )
    Bán Blog Star Dũ IT (  WWW.StarDuIT.Com  ) Tổng Cộng Lượt View Là 61k ( Như Hình ) Giá Ra Đi Blog Là 200k ( Còn Fix Giá ) Đại Gia Nào Ưng Ý ...
  • Vua Sư Tử - The Lion King Gifs
    Vua Sư Tử - The Lion King Gifs
    Vua sư tử là một phim hoạt hình thứ 32 của hãng hoạt hình Walt Disney vào năm 1994.
  • [SHARE] TUT xóa thông tin tài khoản garena 2016 - Zoy Thủ Thuật #Zoy
    [SHARE] TUT xóa thông tin tài khoản garena 2016 - Zoy Thủ Thuật #Zoy
    Hello mọi người , Mình là Ken ! Hôm nay mình sẽ chia sẽ cho các bạn 1 thủ thuật cực mới, cách để xóa thông tin garena 1 cách cực kì nhanh ch...
  • Hướng dẫn hack game rắn ăn mồi Slither.Io trên máy tính 2016 - Zoy Thủ Thuật #Zoy
    Hướng dẫn hack game rắn ăn mồi Slither.Io trên máy tính 2016 - Zoy Thủ Thuật #Zoy
    Hướng dẫn hack game rắn ăn mồi Slither.Io trên máy tính với Tampermonkey . Bản hack bao gồm: hack zoom, hack tự xoay tròn, hack tự động chơi...
  • Bandicam Full Crack - Duy Ripper
    Bandicam Full Crack - Duy Ripper
     
Google
Custom Search
Support: Facebook | Twitter | Google+ | Giới thiệu
Copyright © 2015 • Phan Anh Buổi Sáng • All Right Reserved. Template by Template Việt